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

Wrong OID for Primary Key and UNIQUE constraints shown in property pane

From: "Harald Armin Massa" <haraldarminmassa(at)gmail(dot)com>
To: "pgAdmin Support" <pgadmin-support(at)postgresql(dot)org>
Subject: Wrong OID for Primary Key and UNIQUE constraints shown in property pane
Date: 2007-04-04 13:41:05
Message-ID: 7be3f35d0704040641n1e2ddceax4cf5fee26a387790@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-support
Hello,

I tried to get the definition of unique and primary key constraints via

select pg_get_constraintdef(<oidofconstraint>)

as oidofconstraint I put the OID displayed in pg_admins property pain when
selecting a constraint.

This failed with

ERROR: could not find tuple for constraint 36099
SQL state: XX000

when I took the OID from UNIQUE and PRIMARY KEY constraints.

Then I moved on and took the OID from FOREIGN KEY constraints, and got
results...


digging in pg_catalog.pg_constraints made me learn that pg_admin shows those
OIDs for UNIQUE and PRIMARY key constraints "off by one", that is:

if  I do

select pg_get_constraintdef(36100)

instead of

select pg_get_constraintdef(36099)

I get the needed result....

Please find that "-1" and add it again :)

Best wishes,

Harald


-- 
GHUM Harald Massa
persuadere et programmare
Harald Armin Massa
Reinsburgstra├če 202b
70197 Stuttgart
0173/9409607
fx 01212-5-13695179
-
Python: the only language with more web frameworks than keywords.

Responses

pgadmin-support by date

Next:From: Dave PageDate: 2007-04-04 15:52:59
Subject: Re: Wrong OID for Primary Key and UNIQUE constraints shown in property pane
Previous:From: Raymond O'DonnellDate: 2007-04-04 10:54:16
Subject: Re: Document for PgAdmin

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