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

Incorrect domain logic for 9.1

From: Thom Brown <thom(at)linux(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Incorrect domain logic for 9.1
Date: 2012-04-21 21:21:59
Message-ID: CAA-aLv5O=ihNPmcFe+8hLTXL9XMv+i5=WLa=6p02yj5k=goeDw@mail.gmail.com (view raw or flat)
Thread:
Lists: pgadmin-hackers
Hi,

I noticed that if I create a domain based on an array data type, it
doesn't get listed in the Domains node if the server is 9.1.  This is
because the query that gets the domains says that if the number of
dimensions used is greater than 0 (which it will be if it's an array),
then it must match against the OID shown in typelem.  As of 9.1 that's
no longer the case as typelem isn't used for domains anymore, although
I don't see why this was ever used by PgAdmin to get a list of domains
as it copes fine without this logic since typbasetype always provides
the necessary info.  Is the constituent base type of the array type
relevant anywhere in the domains section of PgAdmin?  I can't find any
place it actually uses it.

The attached patch removes the join logic completely to make it a
straightforward join.  From what I can tell (testing it against 8.4),
everything continues to work as usual, and now allows array-based
domains to be visible for 9.1 instances.

Could someone take a look, and see if there are cases this might
break?  In any case, a fix is needed.

-- 
Thom

Attachment: fix_domain_logic.patch
Description: application/octet-stream (790 bytes)

Responses

pgadmin-hackers by date

Next:From: Dave PageDate: 2012-04-23 08:12:37
Subject: Re: Remaining work for 1.16
Previous:From: Guillaume LelargeDate: 2012-04-21 18:08:00
Subject: Remaining work for 1.16

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