rotemseekingalpha commented on issue #27163:
URL: https://github.com/apache/airflow/issues/27163#issuecomment-1285623301
As I understand it, the tables unique constraints should be created with
default as the corresponding sequence's next value.
```
airflow=> DROP TABLE IF EXISTS t CASCADE;
DROP TABLE
airflow=> CREATE TABLE t(id INT NOT NULL PRIMARY KEY, name VARCHAR(10));
CREATE TABLE
airflow=> DROP SEQUENCE IF EXISTS t_id_seq;
DROP SEQUENCE
airflow=> CREATE SEQUENCE t_id_seq START WITH 1;
CREATE SEQUENCE
airflow=> ALTER TABLE t ALTER COLUMN id DROP DEFAULT;
ALTER TABLE
airflow=> ALTER TABLE t ALTER COLUMN id SET DEFAULT NEXTVAL('t_id_seq');
ALTER TABLE
airflow=> INSERT INTO t (name) VALUES ('aaa');
INSERT 0 1
airflow=> SELECT * FROM t;
id | name
----+------
1 | aaa
(1 row)
--
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]