Re: Alter table syntax - Mailing list pgsql-general

From Patrick Nelson
Subject Re: Alter table syntax
Date
Msg-id 4165C48DE9A0D211B6400800095C585F172E81@WASHINGTON
Whole thread Raw
In response to Alter table syntax  (Garo Hussenjian <garo@xapnet.com>)
List 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 by date:

Previous
From: "ilir gashi"
Date:
Subject: Request for List of Known Bugs
Next
From: Harald Fuchs
Date:
Subject: Re: referential integrity violation