diff --git a/pegjs/postgresql.pegjs b/pegjs/postgresql.pegjs index 52ff95aa..0b709822 100644 --- a/pegjs/postgresql.pegjs +++ b/pegjs/postgresql.pegjs @@ -14,6 +14,7 @@ 'CASE': true, 'CREATE': true, 'CONTAINS': true, + 'CONSTRAINT': true, 'CURRENT_DATE': true, 'CURRENT_TIME': true, 'CURRENT_TIMESTAMP': true, diff --git a/test/postgres.spec.js b/test/postgres.spec.js index d62d89db..858db622 100644 --- a/test/postgres.spec.js +++ b/test/postgres.spec.js @@ -1912,6 +1912,16 @@ describe('Postgres', () => { 'CREATE SCHEMA public' ] }, + { + title: 'create constraint with quoted name', + sql: [ + `CREATE TABLE "User" ( + "id" SERIAL NOT NULL, + CONSTRAINT "User_pkey" PRIMARY KEY ("id") + );`, + 'CREATE TABLE "User" ("id" SERIAL NOT NULL, CONSTRAINT "User_pkey" PRIMARY KEY ("id"))' + ] + }, ] neatlyNestTestedSQL(SQL_LIST) })