LucaCappelletti94 opened a new pull request, #2745: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2745
`ALTER FOREIGN TABLE` did not parse, so a `pg_dump --schema-only` of any database holding a foreign table stopped at the `ALTER FOREIGN TABLE public.ft OWNER TO postgres` line it writes for each one, with `Expected: one of VIEW or TYPE ..., found: FOREIGN`. The statement now goes through the `ALTER TABLE` path with a new `AlterTableType::Foreign`, so the AST still says it was foreign. PostgreSQL's grammar shares the table `OPTIONS ( [ ADD | SET | DROP ] option ['value'] )` action and `ALTER COLUMN ... OPTIONS (...)` with `ALTER TABLE`, so both are parsed there as `GenericOptions`. Each element keeps which of `ADD`, `SET` or `DROP` was written, because PostgreSQL refuses `SET` on an option that is not there yet. https://www.postgresql.org/docs/current/sql-alterforeigntable.html -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
