pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marc Balmer <marc@msys.ch>
To: pgsql-bugs@postgresql.org
To: brush.tyler@gmail.com
Subject: Re: Different error messages executing CREATE TABLE or ALTER TABLE to create a column "xmin"
Date: Mon, 23 Jan 2012 11:25:01 +0100
Message-ID: <4F1D357D.5080407@msys.ch> (raw)
In-Reply-To: <CAA6k8-LSvJ8jGpJd2gUr6W47KkCuvy23fo3bzqCsmFP0BMoAUA@mail.gmail.com>
References: <CAA6k8-LSvJ8jGpJd2gUr6W47KkCuvy23fo3bzqCsmFP0BMoAUA@mail.gmail.com>

Am 22.01.12 14:22, schrieb Giuseppe Sucameli:
> Hi all,
> 
> trying to create a table with a column xmin I get the
> following error message:
> 
> test=> create table lx (xmin int);
> ERROR:  column name "xmin" conflicts with a system
> column name
> 
> Instead I get a different (and less understandable) error
> message if I try to add a column named xmin to an
> existent table:
> 
> test=> create table lx (i int);
> CREATE TABLE
> test=> alter table lx add xmin int;
> ERROR:  column "xmin" of relation "lx" already exists.
> 
> The same problem occurs using "xmax" as column name.
> 
> I'm on Ubuntu 11.04.
> Tried on both PostgreSQL 8.4.10 and 9.1.2

That is not a bug, but a feature.  See section 5.4 of the documentation
"System Columns":

"Every table has several system columns that are implicitly defined by
the system. Therefore, these names cannot be used as names of
user-defined columns. (Note that these restrictions are separate from
whether the name is a key word or not; quoting a name will not allow you
to escape these restrictions.) You do not really need to be concerned
about these columns; just know they exist."

and further down:

"xmin

The identity (transaction ID) of the inserting transaction for this row
version. (A row version is an individual state of a row; each update of
a row creates a new row version for the same logical row.)"




view thread (9+ messages)  latest in thread

Message-ID: <4F1D357D.5080407@msys.ch>
Permalink:  ../4F1D357D.5080407@msys.ch/
Also on:    postgresql.org/message-id/4F1D357D.5080407@msys.ch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: marc@msys.ch, brush.tyler@gmail.com
  Subject: Re: Different error messages executing CREATE TABLE or ALTER TABLE to create a column "xmin"
  In-Reply-To: <4F1D357D.5080407@msys.ch>
  References: <CAA6k8-LSvJ8jGpJd2gUr6W47KkCuvy23fo3bzqCsmFP0BMoAUA@mail.gmail.com> <4F1D357D.5080407@msys.ch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox