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

Re: Alter column / array

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Rolf Lüttecke <rolf(dot)luettecke(at)michael-telecom(dot)de>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Alter column / array
Date: 2001-10-12 15:29:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
=?iso-8859-1?Q?Rolf_L=FCttecke?= <rolf(dot)luettecke(at)michael-telecom(dot)de> writes:
>> I can't find out why the following command give different results:

> ALTER TABLE ADD COLUMN doesn't support adding a default.  (There is a
> test in the code that's supposed to kick out an error message telling
> you so, but it doesn't seem to be working.  Need to look at that.)

I've committed fixes for that problem in 7.2.

> Hmm ... I wonder why ADD COLUMN doesn't just call the SET DEFAULT
> routine to handle adding the default ...

On looking at the archives (see pgsql-hackers around 17-Jul-01),
I see that this wasn't done because it's not an SQL92-compliant
behavior.  Our current implementation of ADD COLUMN can't support
setting the new column's entries to anything except NULL, but the
spec says that if there's a DEFAULT then the column should initially
be filled with that value.

			regards, tom lane

In response to

pgsql-admin by date

Next:From: Tom LaneDate: 2001-10-12 17:27:04
Subject: Re: Permission Denied When i am Trying to take Backup
Previous:From: postgresqlDate: 2001-10-12 12:33:44
Subject: Re: Permission Denied When i am Trying to take Backup

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