Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id C30A0D7D9BE for ; Mon, 23 Jan 2012 06:25:18 -0400 (AST) Received: from [2001:4060:c0de:f000::3] (helo=sleipnir.msys.ch) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RpH5S-0006YY-1q for pgsql-bugs@postgresql.org; Mon, 23 Jan 2012 10:25:18 +0000 Received: from mail.msys.ch (smtp.msys.ch [157.161.101.10]) by sleipnir.msys.ch (8.14.3/8.14.3) with ESMTP id q0NAP2ZQ023465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Jan 2012 11:25:02 +0100 (CET) Received: from macbook-mb.vnode.ch (macbook-mb.vnode.ch [87.102.253.80]) (authenticated bits=0) by mail.msys.ch (8.14.3/8.14.1) with ESMTP id q0NAP1ds005415 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 23 Jan 2012 11:25:01 +0100 (CET) Message-ID: <4F1D357D.5080407@msys.ch> Date: Mon, 23 Jan 2012 11:25:01 +0100 From: Marc Balmer Organization: micro systems User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: pgsql-bugs@postgresql.org, brush.tyler@gmail.com Subject: Re: Different error messages executing CREATE TABLE or ALTER TABLE to create a column "xmin" References: In-Reply-To: X-Enigmail-Version: 1.3.4 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SMTP-Vilter-Version: 1.3.6 X-Spamd-Symbols: AWL,RCVD_IN_DNSWL_LOW X-Host-Lookup-Failed: Reverse DNS lookup failed for 2001:4060:c0de:f000::3 (failed) X-Pg-Spam-Score: 0.8 (/) X-Archive-Number: 201201/153 X-Sequence-Number: 32220 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.)"