Observed an issue in CREATE TABLE syntax - Mailing list pgsql-hackers

From Rajeev rastogi
Subject Observed an issue in CREATE TABLE syntax
Date
Msg-id BF2827DCCE55594C8D7A8F7FFD3AB7713DDDEBC5@SZXEML508-MBX.china.huawei.com
Whole thread Raw
Responses Re: Observed an issue in CREATE TABLE syntax  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

I observed an issue that even if invalid syntax is provided for CREATE TABLE, table is getting created successfully.

               

                Below table creation succeed even though same constraint name is given multiple times.

                None of the below constraints has any meaning of giving multiple times.

 

                postgres=# create table new (id int NULL NULL);

CREATE TABLE

 

postgres=# create table new1(id serial NOT NULL NOT NULL);

CREATE TABLE

 

postgres=# create table new2 (id int unique unique);

CREATE TABLE  

 

Should we not throw error for above syntaxes?

 

Please find the attached patch with the fix.

 

Thanks and Regards,

Kumar Rajeev Rastogi

 

Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: WAL format and API changes (9.5)
Next
From: Florian Pflug
Date:
Subject: Re: [PATCH] Negative Transition Aggregate Functions (WIP)