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
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-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 Content-Type Size
adddepend.patch text/plain 614 bytes

Browse pgsql-bugs by date

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

Browse pgsql-patches by date

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