I have a databse dump db.sql.schema
I import it using psql -U user dbname < ~/db.sql.schema
After import in my DB I see table mytable but not mytable_id_seq.
# \d mytable
Table mytable
Column | Type | Collation | Nullable | Default
-------------------+--------------+-----------+----------+---------
id | integer | | not null |
field1 | integer | | not null |
field2 | integer | | not null |
field3 | integer | | not null |
I got the follwong error:
# INSERT INTO mytable (field1, field2, field3) VALUES (1, 1, 1) RETURNING mytable.id;
ERROR: null value in column "id" violates not-null constraint
DETAIL: Failing row contains (null, 1, 1, 1).
My postgres version is 10.12 It looks like auto-increment of id doesn't works. Is it a postgres issue or issue with my dump? Is it loo old or too new?
CREATE SEQUENCE qqq AS smallint; ERROR: syntax error at or near "AS" LINE 1: CREATE SEQUENCE qqq AS smallint;But my postgres10.12 should supportAS data_type!