[Checkins] SVN: relstorage/branches/postgres_blob_oid/ Migration script for older 1.5.0 blob_chunk schemas on PostgreSQL.
Martijn Pieters
mj at zopatista.com
Wed Jun 15 13:29:09 EDT 2011
Log message for revision 121951:
Migration script for older 1.5.0 blob_chunk schemas on PostgreSQL.
Changed:
U relstorage/branches/postgres_blob_oid/CHANGES.txt
U relstorage/branches/postgres_blob_oid/notes/migrate-to-1.5.txt
-=-
Modified: relstorage/branches/postgres_blob_oid/CHANGES.txt
===================================================================
--- relstorage/branches/postgres_blob_oid/CHANGES.txt 2011-06-15 15:37:59 UTC (rev 121950)
+++ relstorage/branches/postgres_blob_oid/CHANGES.txt 2011-06-15 17:29:09 UTC (rev 121951)
@@ -14,6 +14,9 @@
- On Oracle and PostgreSQL, switch to storing ZODB blob in chunks up to 4GB
(the maximum supported by cx_Oracle) or 2GB (PostgreSQL maximum blob size)
to maximize blob reading and writing performance.
+
+ The PostgreSQL blob_chunk schema changed to support this, see
+ notes/migrate-to-1.5.txt to update existing databases.
1.5.0b2 (2011-03-02)
--------------------
Modified: relstorage/branches/postgres_blob_oid/notes/migrate-to-1.5.txt
===================================================================
--- relstorage/branches/postgres_blob_oid/notes/migrate-to-1.5.txt 2011-06-15 15:37:59 UTC (rev 121950)
+++ relstorage/branches/postgres_blob_oid/notes/migrate-to-1.5.txt 2011-06-15 17:29:09 UTC (rev 121951)
@@ -21,7 +21,20 @@
ALTER TABLE object_state ALTER COLUMN state_size SET NOT NULL;
COMMIT;
+If you used RelStorage a 1.5.0 version before version b3 you'll need to
+migrate your blob_chunk table schema:
+ BEGIN;
+ ALTER TABLE blob_chunk RENAME COLUMN chunk TO oldbytea;
+ ALTER TABLE blob_chunk ADD COLUMN chunk OID;
+ UPDATE blob_chunk bc SET chunk = (
+ SELECT oid FROM (
+ SELECT oid, lowrite(lo_open(oid, 131072), bc.oldbytea)
+ FROM lo_create(0) o(oid)) x);
+ ALTER TABLE blob_chunk ALTER COLUMN chunk SET NOT NULL;
+ ALTER TABLE blob_chunk DROP COLUMN oldbytea;
+ COMMIT;
+
MySQL history-preserving
------------------------
More information about the checkins
mailing list