RE: Removing all NOT NULL constraints from multiple tables easily
От | Dan Browning |
---|---|
Тема | RE: Removing all NOT NULL constraints from multiple tables easily |
Дата | |
Msg-id | 003201c01bf8$45d4b0a0$1500000a@danb обсуждение исходный текст |
Ответ на | Removing all NOT NULL constraints from multiple tables easily ("Dan Browning" <danb@cyclonecomputers.com>) |
Список | pgsql-novice |
-----Original Message-----
From: Sokel, John [mailto:jsokel@mdsi-usa.com]
Sent: Monday, September 11, 2000 6:57 AM
To: Dan Browning
Subject: RE: [NOVICE] Removing all NOT NULL constraints from multiple tables easilyI don't think you can alter that on the fly, but an easier way is too just use 'select into' a temporrary table, recreate, and insert the data back to the original file. That's what I always do, usually pretty quick (unless you have gobs of data).
** Create a temporrary table
Select * into <temp_table> from <orig_table>;** Recreate the file
Drop table <orig_table>;
Create table <orig_table> ...;** Put the data back in
Insert into <orig_table> select * from <temp_table>;** Clean up
Drop table <temp_table>;-----Original Message-----
From: Dan Browning [mailto:danb@cyclonecomputers.com]
Sent: Monday, September 11, 2000 8:32 AM
To: pgsql-general@postgresql.org; pgsql-novice@postgresql.org
Subject: [NOVICE] Removing all NOT NULL constraints from multiple tables
easilyI would like to remove all NOT NULL constraints from my tables.
I've tried ALTER TABLE, but I can't seem to get the syntax right, and the
docs aren't clear to me.
What is the correct syntax? If there's another way, short of manually
recreating (dump, create, import) the tables, I'd love to hear it.Thanks,
Dan Browning
Network & Database Administrator
Cyclone Computer Systems
В списке pgsql-novice по дате отправления: