PostgreSQL create table fails on identity column

Viewed 191

I'm trying to set up a Postgres table using DBeaver as my management tool to run queries. Everything seems to work OK until I try to generate a table with an identity column. I am getting this error:

ERROR: syntax error at or near "GENERATED"

This is the query that is failing:

create table public.test (
    id INT GENERATED BY DEFAULT AS IDENTITY 
)

This query works just fine:

create table public.test (
    id INT
)

I referenced data here and here to make sure the syntax was correct. What's going on?

EDIT: My problem was that my version is too old: 9.5.18 - needs to be 10 for this command to work.

0 Answers
Related