On 11/9/05, Tito Mari Francis EscaƱo <[EMAIL PROTECTED]> wrote:
> Is there an issue on data handling compatibility between PostgreSQL 7.x and 
> 8.x?
>
> Would data dump from v7.x be acceptable to v8.x?
>
> Our test app was developed using 7.x, specifically 7.4.8. Now, knowing
> the features of version 8.x, particularly 8.0.4, I think this will
> have a long-term benefit for the server if no issue will hinder.

Another heads-up on 7.x /8.0.x and 8.1 database migration:

Postgresql 8.1 ships with default_with_oids() in postgresql.conf
turned off. if your application or database (plsql) code uses oids, it
is going to break.

>From the 8.1 release notes [1]:

"default_with_oids is now false by default (Neil)

With this option set to false, user-created tables no longer have an
OID column unless WITH OIDS is specified in CREATE TABLE. Though OIDs
have existed in all releases of PostgreSQL, their use is limited
because they are only four bytes long and the counter is shared across
all installed databases. The preferred way of uniquely identifying
rows is via sequences and the SERIAL type, which have been supported
since PostgreSQL 6.4."


An example of this is PHP ADODb's ADOConnection->GetID() method [2]
which, if you're using postgresql, returns the oid of the last
inserted row.

To get around this, what I did was to:

1. Turn default_with_oid to "on" in postgresql.conf and then restart
the postgresql service
2. Add the -o (dump object identifiers) option in your pg_dump command
on the old database.
3. Restore your database dump (with oids) to the 8.1 database.


[1] http://www.postgresql.org/docs/8.1/interactive/release.html#RELEASE-8-1
[2] http://phplens.com/adodb/reference.functions.insert_id.html

--
Stand before it and there is no beginning.
Follow it and there is no end.
Stay with the ancient Tao,
Move with the present.
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to