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

ADD GENERATED ALWAYS throws Unsupported command exception #266

Open
ehn-rickk opened this issue Jan 28, 2020 · 2 comments
Open

ADD GENERATED ALWAYS throws Unsupported command exception #266

ehn-rickk opened this issue Jan 28, 2020 · 2 comments

Comments

@ehn-rickk
Copy link

me@my_host:~/dev/my_org/my_db$ java -jar ~/lib/java/apgdiff-2.4/apgdiff-2.4.jar --ignore-start-with ./my_db.pg_dump.localhost.sql ./my_db.pg_dump.stage.sql
Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: ALTER TABLE public.my_databases ALTER COLUMN my_db_id ADD GENERATED ALWAYS AS IDENTITY (
SEQUENCE NAME public.my_db_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1
);
Unsupported command at position 57 'ADD GENERATED ALWAYS'
at cz.startnet.utils.pgdiff.parsers.Parser.throwUnsupportedCommand(Parser.java:390)
at cz.startnet.utils.pgdiff.parsers.AlterTableParser.parseAlterColumn(AlterTableParser.java:294)
at cz.startnet.utils.pgdiff.parsers.AlterTableParser.parse(AlterTableParser.java:79)
at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:180)
at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:236)
at cz.startnet.utils.pgdiff.PgDiff.createDiff(PgDiff.java:29)
at cz.startnet.utils.pgdiff.Main.main(Main.java:39)

me@my_host:~/dev/my_org/my_db$ < ./my_db_create.sql sed -rne '/CREATE.*my_databases/,/GRANT/ p'
CREATE TABLE IF NOT EXISTS my_databases(
f1 integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY,

f2 text,
f3 text,

f4 text,
f5 text,

f6 text
);
GRANT SELECT ON TABLE my_databases TO read_user;

@ehn-rickk
Copy link
Author

ehn-rickk commented Jan 28, 2020

Also:

me@my_host:~/dev/my_org/my_db$ java -jar ~/lib/java/apgdiff-2.4/apgdiff-2.4.jar --ignore-start-with ./my_db.pg_dump.localhost.sql ./my_db.pg_dump.stage.sql
Exception in thread "main" cz.startnet.utils.pgdiff.parsers.ParserException: Cannot parse string: CREATE SEQUENCE public.my_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
Unsupported command at position ## 'AS integer
START'
at cz.startnet.utils.pgdiff.parsers.Parser.throwUnsupportedCommand(Parser.java:390)
at cz.startnet.utils.pgdiff.parsers.CreateSequenceParser.parse(CreateSequenceParser.java:80)
at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:183)
at cz.startnet.utils.pgdiff.loader.PgDumpLoader.loadDatabaseSchema(PgDumpLoader.java:236)
at cz.startnet.utils.pgdiff.PgDiff.createDiff(PgDiff.java:29)
at cz.startnet.utils.pgdiff.Main.main(Main.java:39)

me@my_host:~/dev/my_org/my_db$ < ./my_db_create2.sql sed -rne '/^CREATE SEQUENCE.*my_id_seq/,/^\s*$/ p'
CREATE SEQUENCE my_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;

@jalissonmello
Copy link
Contributor

Can you help testing ? There is 2.6.1 jar on https://github.com/jalissonmello/apgdiff/tree/develop/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants