Observed an issue in CREATE TABLE syntax

From: Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Observed an issue in CREATE TABLE syntax
Date: 2014-04-04 10:36:17
Message-ID: BF2827DCCE55594C8D7A8F7FFD3AB7713DDDEBC5@SZXEML508-MBX.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
multiconstissuev1.patch application/octet-stream 3.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2014-04-04 10:50:29 Re: [PATCH] Negative Transition Aggregate Functions (WIP)
Previous Message Andres Freund 2014-04-04 10:05:06 Re: WAL format and API changes (9.5)