pg_dump/restore to convert BLOBs to LZTEXT (optional!)

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: pgsql-hackers(at)postgreSQL(dot)org, pgsql-general(at)postgreSQL(dot)org
Subject: pg_dump/restore to convert BLOBs to LZTEXT (optional!)
Date: 2000-08-04 00:54:02
Message-ID: 3.0.5.32.20000804105402.0227d300@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


Now that I *seem* to have a pg_dump/restore that handles BLOBs (for 7.0.2
and 7.1), would there be any value in adding a 'conversion' option to
pg_restore (for 7.1)?

The idea being that there are probably people out there who use BLOBs for
large text fields, who *might* be better served is using LZTEXT (or
whatever is appropriate) in 7.1.

At this stage I am not sure *how* I would do the conversion, but my initial
thought would be to store the BLOB as an LZTEXT in a temp table, then find
all tables with BLOB columns, either do an ALTER TABLE ALTER COLUMN <name>
LZTEXT (if supported?), or just add a new column? Then set the column value
to the new LZTEXT.

Another option would be to do 'alter table add <newname> lztext', then load
the data, drop the old column and rename the new one...

For BLOBS that are referenced in more than one table, this will duplicate
the text which may be a problem, but this is only enforcing what should
have been the case all along, I think.

I'd be interested in feedback from people who think this would be a
good/bad idea as well as any ideas on how to implement it nicely...

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-08-04 01:10:53 Re: [HACKERS] pg_dump/restore to convert BLOBs to LZTEXT (optional!)
Previous Message BJB 2000-08-03 21:53:54 Database security via a special ODBC connection possible?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-08-04 00:55:15 Re: Anyone particularly wedded to func_tlist mechanism?
Previous Message Hiroshi Inoue 2000-08-04 00:43:50 RE: Anyone particularly wedded to func_tlist mechanism?