Re: [HACKERS] ALTER TABLE ... ADD COLUMN

2002-10-04 Thread Alvaro Herrera
On Fri, Oct 04, 2002 at 05:57:02PM -0400, Tom Lane wrote: > Alvaro Herrera <[EMAIL PROTECTED]> writes: > > I'm thinking about ALTER TABLE ... ADD COLUMN working properly when > > child tables already contain the column. > > There are two cases: one when specifying ALTER TABLE ONLY, and other > > w

Re: [HACKERS] ALTER TABLE ... ADD COLUMN

2002-10-04 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes: > I'm thinking about ALTER TABLE ... ADD COLUMN working properly when > child tables already contain the column. > There are two cases: one when specifying ALTER TABLE ONLY, and other > when specifying recursive (not ONLY). I think ALTER TABLE ONLY ... A

[HACKERS] ALTER TABLE ... ADD COLUMN

2002-10-04 Thread Alvaro Herrera
Hello hackers, I'm thinking about ALTER TABLE ... ADD COLUMN working properly when child tables already contain the column. I have two proposals. First one: There are two cases: one when specifying ALTER TABLE ONLY, and other when specifying recursive (not ONLY). In the first (ONLY) case, chi

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-17 Thread Hiroshi Inoue
Tom Lane wrote: > > Hiroshi Inoue <[EMAIL PROTECTED]> writes: > > Christopher Kings-Lynne wrote: > >> Just out of interest, is there a special reason it's difficult to implement > >> the DEFAULT feature of alter table add column? > > > Without *DEFAULT* we don't have to touch the table file > > a

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpectedresults

2001-07-17 Thread Peter Eisentraut
Tom Lane writes: > Besides, it seems to me there are cases where you don't really > *want* the DEFAULT value to be used to fill the column, but something > else (or even want NULLs). Then you could use ALTER TABLE t1 ADD COLUMN cn text; ALTER TABLE t1 ALTER COLUMN cn SET DEFAULT 'what you reall

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-17 Thread Tom Lane
Hiroshi Inoue <[EMAIL PROTECTED]> writes: > Christopher Kings-Lynne wrote: >> Just out of interest, is there a special reason it's difficult to implement >> the DEFAULT feature of alter table add column? > Without *DEFAULT* we don't have to touch the table file > at all. With *DEFAULT* we have to

RE: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-16 Thread Christopher Kings-Lynne
> *ALTER TABLE* isn't as easy as *CREATE TABLE*. > It has another problem because it hasn't implemented > *DEFAULT* yet. Just out of interest, is there a special reason it's difficult to implement the DEFAULT feature of alter table add column? Chris ---(end of broadcast

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-16 Thread Hiroshi Inoue
Christopher Kings-Lynne wrote: > > > *ALTER TABLE* isn't as easy as *CREATE TABLE*. > > It has another problem because it hasn't implemented > > *DEFAULT* yet. > > Just out of interest, is there a special reason it's difficult to implement > the DEFAULT feature of alter table add column? > With

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-16 Thread Hiroshi Inoue
Tom Lane wrote: > > "Rod Taylor" <[EMAIL PROTECTED]> writes: > > Running: > > ALTER TABLE table ADD COLUMN column SERIAL; > > Defines a column as int4 but does not create the sequence or attempt > > to set the default value. > > Yeah ... SERIAL is implemented as a hack in the parsing of CREATE

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-16 Thread Bruce Momjian
> "Rod Taylor" <[EMAIL PROTECTED]> writes: > > Running: > > ALTER TABLE table ADD COLUMN column SERIAL; > > Defines a column as int4 but does not create the sequence or attempt > > to set the default value. > > Yeah ... SERIAL is implemented as a hack in the parsing of CREATE > TABLE, but there

Re: [HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-16 Thread Tom Lane
"Rod Taylor" <[EMAIL PROTECTED]> writes: > Running: > ALTER TABLE table ADD COLUMN column SERIAL; > Defines a column as int4 but does not create the sequence or attempt > to set the default value. Yeah ... SERIAL is implemented as a hack in the parsing of CREATE TABLE, but there's no correspond

[HACKERS] ALTER TABLE ADD COLUMN column SERIAL -- unexpected results

2001-07-16 Thread Rod Taylor
Running: ALTER TABLE table ADD COLUMN column SERIAL; Defines a column as int4 but does not create the sequence or attempt to set the default value. Not a big deal, but I was surprised when the column values were null. -- Rod Taylor Your eyes are weary from staring at the CRT. You feel sleep