Lists: | pgsql-hackers |
---|
From: | Joel Jacobson <joel(at)gluefinance(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Possible bug in pg_settings/pg_depend |
Date: | 2011-01-13 10:13:54 |
Message-ID: | AANLkTikszqFsnCMegodKdqDgiG23ezeQnjQYOZVAFB6H@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Are multiple identical entires in pg_depend possible?
If so, how do they occur, and what is the purpose of representing
exactly the same dependency two times in pg_depend?
I expected the following query not to return any rows, but it did:
glue=# select count(*), * from pg_depend group by classid, objid,
objsubid, refclassid, refobjid, refobjsubid, deptype having count(*) >
1;
count | classid | objid | objsubid | refclassid | refobjid |
refobjsubid | deptype
-------+---------+-------+----------+------------+----------+-------------+---------
2 | 2618 | 11015 | 0 | 1259 | 11012 | 1 | n
(1 row)
Debug data:
glue=# select version();
version
-------------------------------------------------------------------------------------------------------------
PostgreSQL 9.1alpha3 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(Ubuntu 4.4.3-4ubuntu5) 4.4.3, 64-bit
(1 row)
glue=# select pg_describe_object(2618,11015,0);
pg_describe_object
----------------------------------------
rule pg_settings_u on view pg_settings
(1 row)
glue=# select pg_describe_object(1259,11012,1); pg_describe_object
------------------------------
view pg_settings column name
(1 row)
--
Best regards,
Joel Jacobson
Glue Finance
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Joel Jacobson <joel(at)gluefinance(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible bug in pg_settings/pg_depend |
Date: | 2011-01-13 18:20:53 |
Message-ID: | 20228.1294942853@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Joel Jacobson <joel(at)gluefinance(dot)com> writes:
> Are multiple identical entires in pg_depend possible?
Yes, probably. It's certainly possible to have the same linkage occur
with different deptypes. We don't try hard to avoid dups because they
don't matter.
regards, tom lane
From: | Joel Jacobson <joel(at)gluefinance(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible bug in pg_settings/pg_depend |
Date: | 2011-01-13 19:04:04 |
Message-ID: | AANLkTikVB8Y0ApbSTOw3ofO56Dh_WEV8jgauBpW=SM7w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
2011/1/13 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Yes, probably. It's certainly possible to have the same linkage occur
> with different deptypes. We don't try hard to avoid dups because they
> don't matter.
"with different deptypes", yes, but in this case there were two
linkages of the same deptype.
Just seems a bit strange I only found one such in the entire database,
smells like some kind of bug, but might not be, I dunno, just thought
it was worth investigating a bit, but if you're sure about it I of
course trust you.
--
Best regards,
Joel Jacobson
Glue Finance
E: jj(at)gluefinance(dot)com
T: +46 70 360 38 01
Postal address:
Glue Finance AB
Box 549
114 11 Stockholm
Sweden
Visiting address:
Glue Finance AB
Birger Jarlsgatan 14
114 34 Stockholm
Sweden
From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Joel Jacobson <joel(at)gluefinance(dot)com> |
Cc: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Possible bug in pg_settings/pg_depend |
Date: | 2011-01-13 19:43:13 |
Message-ID: | AANLkTik1Yemt_P-qQCEz7jdQ=ZDq3vFME9QS5AtRnqjz@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Thu, Jan 13, 2011 at 2:04 PM, Joel Jacobson <joel(at)gluefinance(dot)com> wrote:
> 2011/1/13 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> Yes, probably. It's certainly possible to have the same linkage occur
>> with different deptypes. We don't try hard to avoid dups because they
>> don't matter.
>
> "with different deptypes", yes, but in this case there were two
> linkages of the same deptype.
>
> Just seems a bit strange I only found one such in the entire database,
> smells like some kind of bug, but might not be, I dunno, just thought
> it was worth investigating a bit, but if you're sure about it I of
> course trust you.
Instead of trusting him, you could investigate why it happens. A
quick test shows this eliminates both dependencies:
drop rule pg_settings_u on pg_settings;
It appears that both of the dependencies in question are from that
rule and pointing to pg_settings.name, and it looks like that rule
mentions the name column of pg_settings twice. With a little further
experimentation you can probably tease out whether each of the two
mentions produced a separate dependency... my guess is "yes".
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company