Skip site navigation (1) Skip section navigation (2)

Re: Different error messages executing CREATE TABLE or ALTER TABLE to create a column "xmin"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Vik Reykja <vikreykja(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Different error messages executing CREATE TABLE or ALTER TABLE to create a column "xmin"
Date: 2012-01-26 16:29:38
Message-ID: 5886.1327595378@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> However, I think we ought to handle
> renaming a column symmetrically to adding one.

Yeah, I was thinking the same.

> So here's a revised version of your patch that does that.

This looks reasonable to me, except that possibly the new error message
text could do with a bit more thought.  It seems randomly unlike the
normal message, and I also have a bit of logical difficulty with the
wording equating a "column" with a "column name".  The wording that
is in use in the existing CREATE TABLE case is

column name \"%s\" conflicts with a system column name

We could do worse than to use that verbatim, so as to avoid introducing
a new translatable string.  Another possibility is

column \"%s\" of relation \"%s\" already exists as a system column

Or we could keep the primary errmsg the same as it is for a normal
column and instead add a DETAIL explaining that this is a system column.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Merlin MoncureDate: 2012-01-26 16:41:47
Subject: Re: Simulating Clog Contention
Previous:From: Abhijit Menon-SenDate: 2012-01-26 16:10:26
Subject: Re: information schema/aclexplode doesn't know about default privileges

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group