--0-973054228-1204885829=:99305
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Hi,=0A=0AThere is a little anomaly in the way adding an extra column is
tre=
ated in pgAdmin III 1.8.2.=0A... particularly if this is a NOT NULL
column.=
=0A=0AWhen adding the column my_col with a DEFAULT value, the code
generate=
d will be:=0AALTER TABLE my_table ADD COLUMN my_col boolean;=0AALTER TABLE
=
my_table ALTER COLUMN my_col SET DEFAULT false;=0A=0AThis works fine ...
as=
long as I don't insert columns with NOT NULL property.=0AIn which case, I
=
SUPPOSE it generates:=0AALTER TABLE my_table ADD COLUMN my_col boolean NOT
=
NULL;=0AALTER TABLE my_table ALTER COLUMN my_col SET DEFAULT
false;=0A=0ATh=
is will not work, because the column is created with no default (hence no
v=
alues) and does not sup****t NULL values, hence creation fails.=0A=0A** In
p=
gAdmin, adding an extra column with NOT NULL property is impossible !
**=0A=
=0ASo I would suggest to generate the code:=0AALTER TABLE my_table ADD
COLU=
MN my_col boolean NOT NULL DEFAULT false;=0A=0AWhich does work !=0AAnd
that=
allows to create a column with not NULL values, in one operation, and
more=
im****tantly with the column populated.=0AAt the moment, to perform the
sam=
e operation I have to=0A - create the column, with NULL values.=0A -
update=
the table to populate the column=0A - modify the column to NOT NULL=0A...
=
or write my-self the ALTER TABLE statement !=0A=0A=0ACheers,=0AL@[EMAIL PROTECTED]
Froggy=0A=0A=0A=0A=0A
________________________________________=
_____________________________________ =0AEnvoyez avec Yahoo! Mail. Une
boit=
e mail plus intelligente http://mail.yahoo.fr
--0-973054228-1204885829=:99305
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<html><head><style type=3D"text/css"><!-- DIV {margin:0px;}
--></style></he=
ad><body><div
style=3D"font-family:courier,monaco,monospace,sans-serif;font=
-size:10pt">Hi,<br><br>There is a little anomaly in the way adding an
extra=
column is treated in pgAdmin III 1.8.2.<br>... particularly if this is a
N=
OT NULL column.<br><br>When adding the column my_col with a DEFAULT value,
=
the code generated will be:<br>ALTER TABLE my_table ADD COLUMN my_col
boole=
an;<br>ALTER TABLE my_table ALTER COLUMN my_col SET DEFAULT
false;<br><br>T=
his works fine ... as long as I don't insert columns with NOT NULL
property=
..<br>In which case, I SUPPOSE it generates:<br>ALTER TABLE my_table ADD
COL=
UMN my_col boolean NOT NULL;<br>=0AALTER TABLE my_table ALTER COLUMN
my_col=
SET DEFAULT false;<br><br>This will not work, because the column is
create=
d with no default (hence no values) and does not sup****t NULL values,
hence=
creation fails.<br><br>** In pgAdmin, adding an extra column with NOT
NULL=
property is impossible ! **<br><br>So I would suggest to generate the
code=
:<br>ALTER TABLE my_table ADD COLUMN my_col boolean NOT NULL DEFAULT
false;=
<br><br>Which does work !<br>And that allows to create a column with not
NU=
LL values, in one operation, and more im****tantly with the column
populated=
..<br>At the moment, to perform the same operation I have to<br> -
crea=
te the column, with NULL values.<br> - update the table to populate
th=
e column<br> - modify the column to NOT NULL<br>... or write my-self
t=
he ALTER TABLE statement !<br>=0A<br>=0A<br>Cheers,<br>L@[EMAIL PROTECTED]
>The
Computing=
Froggy<div><br></div></div><br>=0A=0A=0A=0A <hr size=3D"1">
=0AEnvoy=
=C3=A9 avec <a
href=3D"http://us.rd.yahoo.com/mailuk/taglines/isp/control/*=
http://us.rd.yahoo.com/evt=3D52423/*http://fr.docs.yahoo.com/mail/overview/=
index.html">Yahoo! Mail</a>.<br>Une boite mail plus intelligente.
</a></bod=
y></html>
--0-973054228-1204885829=:99305--


|