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

Re: [GENERAL] I think this is a BUG?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brendan Jurd" <direvus(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [GENERAL] I think this is a BUG?
Date: 2008-04-24 16:27:15
Message-ID: 209.1209054435@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
"Brendan Jurd" <direvus(at)gmail(dot)com> writes:
> transformIndexConstraint sets the is_not_null flag on the ColumnDefs
> associated with the primary key.  That works great in a CREATE TABLE
> context, but in ADD COLUMN, when we haven't created the column yet,
> this means that the column is created with attnotnull set to true,
> which tricks DefineIndex into thinking that the column already has a
> NOT NULL constraint.

Huh?  The attnotnull bit *is* the constraint, there is no other
representation.  (There has been talk of making a pg_constraint
entry but it isn't done today.)

I think the bug here is that ADD COLUMN NOT NULL has to fail if
there's not a default expression supplied (except maybe we could
allow it if the table contains no rows).  ISTM we got this right
in the past, wonder why it's not working now ...

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-04-24 16:28:16
Subject: Re: Proposed patch - psql wraps at window width
Previous:From: Decibel!Date: 2008-04-24 16:24:29
Subject: Re: Index AM change proposals, redux

pgsql-general by date

Next:From: Scott MarloweDate: 2008-04-24 16:36:54
Subject: Re: How to modify ENUM datatypes?
Previous:From: Andrew SullivanDate: 2008-04-24 16:22:14
Subject: Re: How to modify ENUM datatypes?

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