Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support COMMENT ON EXTENSION #358

Open
gregwebs opened this issue Feb 20, 2023 · 2 comments
Open

support COMMENT ON EXTENSION #358

gregwebs opened this issue Feb 20, 2023 · 2 comments
Labels
psqldef Bugs or feature requests related to PostgreSQL

Comments

@gregwebs
Copy link

gregwebs commented Feb 20, 2023

Overview

COMMENT ON is supported in #266, but not for EXTENSION.

I wouldn't mind if the comments end up getting dropped, just as long as the SQL gets parsed- in that case a workaround is to filter the comment out of the schema.sql before it gets to sqldef.

psqldef ... <<< $(grep -v 'COMMENT ON EXTENSION' schema.sql)

Platform

  • OS: macOS (probably all)
  • RDBMS: PostgreSQL
  • Version: v0.15.12

--export output

Input SQL

CREATE EXTENSION IF NOT EXISTS pg_stat_statements WITH SCHEMA public;
COMMENT ON EXTENSION pg_stat_statements IS 'track execution statistics of all SQL statements executed';

CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';

Current output

found syntax error when parsing DDL "COMMENT ON EXTENSION ...

Expected output

None compared to the above

@k0kubun
Copy link
Collaborator

k0kubun commented Feb 21, 2023

Thanks for filing an issue. Would you be interested in working on a pull request for it? It would look similar to what b03a6e4 is doing.

@gregwebs
Copy link
Author

It's not clear to me from that change where the parser is actually failing and would need to be modified. I am content to just use my workaround since none of the extension comments I see seem useful.

@k0kubun k0kubun added the psqldef Bugs or feature requests related to PostgreSQL label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
psqldef Bugs or feature requests related to PostgreSQL
Projects
None yet
Development

No branches or pull requests

2 participants