Forum OpenACS Q&A: Re: 4.6 upgrade questions

Collapse
6: Re: 4.6 upgrade questions (response to 4)
Posted by Kevin Murphy on
Roberto et al,

When I loaded my dump (from which I removed just the two handler statements), I got the following unexplained error:

psql:media_db.dmp:731: ERROR:  No such attribute or function 'oid'

The relevant statement is this:

CREATE VIEW "user_col_comments" as SELECT upper(text(c.relname)) AS table_name, upper(text(a.attname)) AS column_name, d.description AS comments FROM pg_class c, (pg\
_attribute a LEFT JOIN pg_description d ON ((a.oid = d.objoid))) WHERE ((c.oid = a.attrelid) AND (a.attnum > 0));

What should I do about this?  The definition of the 7.1 user_col_comments view used by the view creation function in postgresql.org also doesn't work because of the 'missing' oid column.

I am still quite the openacs newbie, so I am out of my element here.  I'm lucky just to know how to do "find /web -name "*.sql" | xargs grep whatever".

Thanks,
Kevin

Collapse
7: Re: 4.6 upgrade questions (response to 6)
Posted by Roberto Mello on
Kevin,

It's probably something I overlooked when writing my pg-migration document.

user_col_comments is defined in packages/acs-kernel/sql/postgresql/postgresql.sql which you should have loaded before starting the migration (as per the migration doc).

So you should get an error, but the error should be that that view is already defined. If you're getting a different error, perhaps you forgot to load the postgresql.sql file.

-Roberto

Collapse
8: Re: 4.6 upgrade questions (response to 7)
Posted by Kevin Murphy on
Roberto,

Sorry to keep pestering.

Here's my error: psql:media-7.1.dmp:752: ERROR:  No such attribute or function 'oid'

I did indeed load postgresql.sql.

When you do:

grep ERROR errors.log | grep -v "already exists"

do you really only get three errors?

I get four:

psql:media-7.1.dmp:752: ERROR:  No such attribute or function 'oid'
psql:media-7.1.dmp:4690: ERROR:  parser: parse error at or near "SELECT"
psql:media-7.1.dmp:4698: ERROR:  parser: parse error at or near "SELECT"
psql:media-7.1.dmp:21336: ERROR:  Relation "party_approved_member_map" does not exist

Here is how I did my stuff.  I have PG 7.1 running on the usual port and PG 7.2 running on port 5424.  I rely on PGPORT to specify the port.  /web/med_dev is the OACS 4.6 tree.  My "media" database and site is OACS 4.5.

EXPORT:

nsadmin@linux:/web/med_dev> which pg_dump
/usr/local/pgsql/bin/pg_dump
nsadmin@linux:/web/med_dev> set | grep PG
nsadmin@linux:/web/med_dev> pg_dump -o media >media-7.1.dmp
nsadmin@linux:/tmp/pg> psql --version
psql (PostgreSQL) 7.1.3

- - -

IMPORT:

nsadmin@linux:/web/med_dev> . ~/pg723.sh
nsadmin@linux:/web/med_dev> set | grep PG
PGDATA=/usr/local/pgsql-7.2.3/data
PGLIB=/usr/local/pgsql-7.2.3/lib
PGPORT=5424
nsadmin@linux:/web/med_dev> export PGPATH=/usr/local/pgsql-7.2.3
nsadmin@linux:/web/med_dev> export PATH=$PGPATH/bin:$PATH
nsadmin@linux:/web/med_dev> which psql
/usr/local/pgsql-7.2.3/bin/psql
nsadmin@linux:/web/med_dev> dropdb med_dev
ERROR:  DROP DATABASE: database "med_dev" does not exist
dropdb: database removal failed
nsadmin@linux:/web/med_dev> createdb -U nsadmin med_dev
CREATE DATABASE
nsadmin@linux:/web/med_dev> psql -U nsadmin -f packages/acs-kernel/sql/postgresql/postgresql.sql med_dev
nsadmin@linux:/web/med_dev> psql -U nsadmin -f media-7.1.dmp med_dev 2> errors.log
nsadmin@linux:/web/med_dev> psql --version
psql (PostgreSQL) 7.2.3

-Kevin Murphy