EVENT Keyword and CREATE TABLE

Lists: pgsql-hackers
From: Brian Weaver <cmdrclueless(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: EVENT Keyword and CREATE TABLE
Date: 2012-09-26 21:56:19
Message-ID: CAAhXZGuF=RK5crp6k48niuOLFYdyHh_j53x121xkke3r-mv7ag@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

I think I just got bitten hard by a commit in mid July... git sha1 3855968.

In some of our old tables going back several years we a column named
'event' as in:

CREATE TABLE tblaudittrail (
id bigint NOT NULL,
siteid integer NOT NULL,
entrytype character varying(25),
form character varying(50),
recordid integer,
field character varying(25),
changedfrom character varying(500),
changedto character varying(500),
changedon timestamp with time zone,
changedby character varying(25),
event character varying(1000)
);

I was working off trunk and the database refuses to create this table
any longer. Is this by design or is it a regression bug?

Thanks

-- Brian
--

/* insert witty comment here */


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Brian Weaver <cmdrclueless(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: EVENT Keyword and CREATE TABLE
Date: 2012-09-27 00:24:06
Message-ID: 9498.1348705446@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Brian Weaver <cmdrclueless(at)gmail(dot)com> writes:
> In some of our old tables going back several years we a column named
> 'event' as in:
> event character varying(1000)
> I was working off trunk and the database refuses to create this table
> any longer. Is this by design or is it a regression bug?

It's a bug. The event-trigger patch added EVENT as a new keyword, but
forgot to list it in the unreserved_keywords production, which is
necessary to make it actually act unreserved.

I've committed a fix, and manually verified there are no other such
errors at present, but this isn't the first time this has happened.
We probably need to put in some automated cross-check, or it won't
be the last time either.

regards, tom lane


From: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Brian Weaver <cmdrclueless(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: EVENT Keyword and CREATE TABLE
Date: 2012-09-27 08:57:00
Message-ID: m2fw63yhb7.fsf@2ndQuadrant.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
> It's a bug. The event-trigger patch added EVENT as a new keyword, but
> forgot to list it in the unreserved_keywords production, which is
> necessary to make it actually act unreserved.

Oh. Oops. Sorry about that.

> I've committed a fix, and manually verified there are no other such
> errors at present, but this isn't the first time this has happened.
> We probably need to put in some automated cross-check, or it won't
> be the last time either.

I see you've added the automated cross-check now, thanks for that!

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support