Re: add column sillyness - Mailing list pgsql-general

From Gaetano Mendola
Subject Re: add column sillyness
Date
Msg-id 3FD67531.8090900@bigfoot.com
Whole thread Raw
In response to add column sillyness  (Thomas Zehetbauer <thomasz@hostmaster.org>)
List pgsql-general
Thomas Zehetbauer wrote:

> Why do I have to use FOUR queries to accomplish the same result I can
> get from MySQL with only ONE query:
>
> alter table users add column $ColumnName text;
> alter table users alter column $ColumnName set default '';
> update users set t_shirt_size='' where $ColumnName is null;
> alter table users alter column $ColumnName set not null;

Wow, that's true!

On MySQL 4.0.16-nt is also possible write:

alter table T1
add CONSTRAINT FK_test foreign key (id)
REFERENCES T2 (id);

that doesn't complain. Unfortunately repeating
the command N times doesn't complain neither.
And the funny here is that FK are not yet supported !


No regards.
Gaetano Mendola







pgsql-general by date:

Previous
From: "Uwe C. Schroeder"
Date:
Subject: Re: Oracle to PostgreSQL migration
Next
From: Martijn van Oosterhout
Date:
Subject: Determining what a user can access