Skip site navigation (1) Skip section navigation (2)

contrib/adddepend failed 8.1.2

From: ISHIDA Akio <iakio(at)mono-space(dot)net>
To: pgsql-bugs(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: contrib/adddepend failed 8.1.2
Date: 2006-01-18 13:05:52
Message-ID: 43CE3D30.8020506@mono-space.net (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Hi.

I was trying to upgrade PostgreSQL from 7.2.8 to 8.1.2.
Dump and restore work well. But adddepend was failed.

To fix it, this regexp
$seq =~ s|^nextval\(["']+([^'"\)]+)["']+.*\)$|$1|g;
need to change
$seq =~ s|^nextval\(\(["']+([^'"\)]+)["']+.*\)$|$1|g;
or
$seq =~ s|^nextval\(\(?["']+([^'"\)]+)["']+.*\)$|$1|g;


----
[ishida(at)localhost adddepend]$ ./adddepend -Y -d ishida


Upgrade the Unique Constraint style via:

DROP INDEX t_i_key RESTRICT;
ALTER TABLE t ADD CONSTRAINT t_i_key UNIQUE (i);

NOTICE:  ALTER TABLE / ADD UNIQUE will create implicit index "t_i_key"
for table "t"
Do you wish to upgrade Sequence 'nextval(('"t_i_seq"'::text)::regclass)'
to SERIAL?
Found on column t.i
DBD::Pg::st execute failed: ERROR:  syntax error at or near ""t_i_seq""
at character 790 at ./adddepend line 539.
----


---- logfile
ERROR:  syntax error at or near ""t_i_seq"" at character 790
STATEMENT:
				  INSERT INTO pg_catalog.pg_depend
				            ( classid
				            , objid
				            , objsubid
				            , refclassid
				            , refobjid
				            , refobjsubid
				            , deptype
				   ) VALUES ( (SELECT c.oid            -- classid
				                 FROM pg_class as c
				                 JOIN pg_namespace as n
				                      ON (n.oid = c.relnamespace)
				                WHERE n.nspname = 'pg_catalog'
				                  AND c.relname = 'pg_class')
	
				            , (SELECT c.oid            -- objid
				                 FROM pg_class as c
				                 JOIN pg_namespace as n
				                      ON (n.oid = c.relnamespace)
				                WHERE n.nspname = 'public'
				                  AND c.relname =
'nextval(('"t_i_seq"'::text)::regclass)')
	
				            , 0                        -- objsubid
	
				            , (SELECT c.oid            -- refclassid
				                 FROM pg_class as c
				                 JOIN pg_namespace as n
				                      ON (n.oid = c.relnamespace)
				                WHERE n.nspname = 'pg_catalog'
				                  AND c.relname = 'pg_class')
	
				            , (SELECT c.oid            -- refobjid
				                 FROM pg_class as c
				                 JOIN pg_namespace as n
				                      ON (n.oid = c.relnamespace)
				                WHERE n.nspname = 'public'
				                  AND c.relname = 't')
	
				            , (SELECT a.attnum         -- refobjsubid
				                 FROM pg_class as c
				                 JOIN pg_namespace as n
				                      ON (n.oid = c.relnamespace)
				                 JOIN pg_attribute as a
				                      ON (a.attrelid = c.oid)
				                WHERE n.nspname = 'public'
				                  AND c.relname = 't'
				                  AND a.attname = 'i')
	
				            , 'i'                      -- deptype
				            );
				

-- 
ISHIDA Akio <iakio(at)mono-space(dot)net / ishida(at)cycleof5th(dot)com>

Attachment: adddepend.patch
Description: text/plain (614 bytes)

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-01-18 15:20:30
Subject: Re: Huge number of disk writes after migration to 8.1
Previous:From: Steven MooijDate: 2006-01-18 12:48:50
Subject: Re: BUG #2168: 45.000.000 records too much?

pgsql-patches by date

Next:From: Tom LaneDate: 2006-01-18 15:20:30
Subject: Re: Huge number of disk writes after migration to 8.1
Previous:From: MarcinDate: 2006-01-18 08:39:10
Subject: Re: Huge number of disk writes after migration to 8.1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group