Re: Alter table syntax
От | Patrick Nelson |
---|---|
Тема | Re: Alter table syntax |
Дата | |
Msg-id | 4165C48DE9A0D211B6400800095C585F172E81@WASHINGTON обсуждение исходный текст |
Ответ на | Alter table syntax (Garo Hussenjian <garo@xapnet.com>) |
Список | pgsql-general |
Garo Hussenjian wrote: ----------------->>>> Can anyone remind me how to make a column 'not null' after it is created? ----------------->>>> From an earlier email (search the archives for more) HTH <snip>................ I ultimately followed the dump-edit-recreate route which was much simpler (and pretty darn fast also) than I thought it would be. I also went with his process of using a recreate.sql file for this and future changes to any of my databases. Based on Joel's email, here is the process I followed: 1. Dump the database using: pg_dump -S postgres <database name> > dbdump.sql 2. Created a file called recreate.sql which looks like: DROP DATABASE <database name>; CREATE DATABASE <database name> WITH TEMPLATE=template1; \c <database name> 3. Added a \i recreate.sql to the top of dbdump.sql and then edited table structure in question. 4. Run the command (just want to see errors): echo "\i dbdump.sql" | psql template1 1>/dev/null 5. Re-dump using similar command in step 1 and diff the two dump files for a sanity check ................<snip>
В списке pgsql-general по дате отправления: