[rt-devel] Postgres, bytea and my ruined evening.
Jesse Vincent
jesse at bestpractical.com
Fri Mar 21 11:55:07 EST 2003
rather than doing a full dump and restore, does this sequence of
commands make sense for updating postgres' schema for RC4?
ALTER TABLE Attachments RENAME COLUMN Content to OldContent;
ALTER TABLE Attachments ADD COLUMN Content text NULL;
UPDATE Attachments SET Content = OldContent;
ALTER TABLE Attachments RENAME COLUMN Headers to OldHeaders;
ALTER TABLE Attachments ADD COLUMN Headers text NULL;
UPDATE Attachments SET Headers = OldHeaders;
ALTER TABLE Attachments DROP Column OldContent;
ALTER TABLE Attachments DROP Column OldHeaders;
ALTER TABLE sessions ADD COLUMN LastUpdated TIMESTAMP not null default current_timestamp;
On Fri, Mar 21, 2003 at 10:29:28AM +1100, Philip Warner wrote:
> At 03:25 PM 20/03/2003 -0500, Jesse Vincent wrote:
> >Also, for the upgrade instructions, what's the recommended postgres
> >procedure for "dump all data, _but not the schema_ from this database to a
> >file on disk and then reload it"?
>
> For 7.2 or less (as well as 7.3 if you want to):
>
> pg_dump -D -a rt-database-name > dump.sql
>
> (-a is a data-only flag).
> (-D says to use column-inserts in case column order changes).
>
> For 7.3:
>
> pg_dump -a rt-database-name > dump.sql
>
> the only advantage of this version is that it is faster for large volumes
> of data -- but because columns may have changed order (or new columns may
> have been added), it will only work in 7.3+
>
>
>
>
>
> ----------------------------------------------------------------
> Philip Warner | __---_____
> Albatross Consulting Pty. Ltd. |----/ - \
> (A.B.N. 75 008 659 498) | /(@) ______---_
> Tel: (+61) 0500 83 82 81 | _________ \
> Fax: (+61) 03 5330 3172 | ___________ |
> Http://www.rhyme.com.au | / \|
> | --________--
> PGP key available upon request, | /
> and from pgp5.ai.mit.edu:11371 |/
>
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-devel
--
http://www.bestpractical.com/rt -- Trouble Ticketing. Free.
More information about the Rt-devel
mailing list