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

PostgreSQL does not support GENERATED columns. #294

Closed
kevincianfarini opened this issue Sep 22, 2021 · 0 comments · Fixed by #295
Closed

PostgreSQL does not support GENERATED columns. #294

kevincianfarini opened this issue Sep 22, 2021 · 0 comments · Fixed by #295

Comments

@kevincianfarini
Copy link
Contributor

Dialect

PostgreSQL

Failing SQL

CREATE TABLE issue (
  id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY
);

CREATE TABLE foo (
  bar BIGINT GENERATED ALWAYS AS (...) STORED
);

Description

Generated tables in PostgreSQL are the preferred method of creating incrementing primary keys using the IDENTITY clause. Furthermore, generated columns can also be used to make calculations on data that exists in other columns of the table.

kevincianfarini added a commit to kevincianfarini/sql-psi that referenced this issue Sep 25, 2021
AlecKazakova pushed a commit that referenced this issue Sep 27, 2021
* Add grammar for PostgreSQL `GENERATED` columns

Closes #294

* Remove test assumption

* Removed unused import

* Fix grammar to line up with postgres create table documentation

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

Successfully merging a pull request may close this issue.

2 participants