Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Syntax error at or near AS integer when creating a sequence

I am getting "error at or near AS integer" in below code when I am trying to execute with psql.

CREATE SEQUENCE public.auth_group_id_seq
    AS integer
    START WITH 1
    INCREMENT BY 1
    NO MINVALUE
    NO MAXVALUE
    CACHE 1;

The above sql statement is from the backup file of local machine postgres version 11 and executing in EC2 postgres version 9.3. I am new to postgres and getting no idea as the sql is generated by postgres only so it should work with psql. Thanks in advance.

like image 863
bihari_gamer Avatar asked Aug 28 '26 17:08

bihari_gamer


1 Answers

Postgres 9.3 (which is no longer supported) did not support the AS data_type option. This was introduced in version 10.

You could try using pg_dump from your 9.3 installation to do the dump, but I am not sure if that works.


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!