X-Original-To: pgadmin-support-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 019D8CC430 for ; Fri, 11 Jul 2003 07:47:10 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 50588-06 for ; Fri, 11 Jul 2003 04:46:58 -0300 (ADT) Received: from gsy_sbs_1.cisx.com (unknown [213.133.202.58]) by svr1.postgresql.org (Postfix) with ESMTP id CC68ECBA36 for ; Thu, 10 Jul 2003 14:08:18 -0300 (ADT) Received: from DEMOLITION ([192.168.100.22]) by gsy_sbs_1.cisx.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id 3T5596AV; Thu, 10 Jul 2003 17:59:38 +0100 Message-ID: <00b601c34706$3b7ba280$1664a8c0@DEMOLITION> From: "Donald Fraser" To: "[pgADMIN]" References: <03AF4E498C591348A42FC93DEA9661B83AF171@mail.vale-housing.co.uk> <7189.1057853195@sss.pgh.pa.us> Subject: Re: [ADMIN] Overloading functions that are used by operators. Date: Thu, 10 Jul 2003 18:10:52 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4927.1200 X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/93 X-Sequence-Number: 1693 ----- Original Message ----- From: "Tom Lane" To: "Dave Page" Cc: "Donald Fraser" ; "[ADMIN]" ; "[pgADMIN]" Sent: Thursday, July 10, 2003 5:06 PM Subject: Re: [ADMIN] [pgadmin-support] Overloading functions that are used by operators. > "Dave Page" writes: > >> I see no such error here ... > >> > >> regression=# create function pg_catalog.textcat(varchar,text) > >> regression-# returns text as 'textcat' language 'internal'; > >> CREATE FUNCTION > > > Andreas (Pflug) reckons it's gone in 7.4, but in 7.3.2 I see: > > [ complicated query ] > > Oh. I'll bet you're running into the regproc-reverse-conversion > problem. 'textcat' is one of the histogram values appearing in pg_stats > for pg_operator.oprcode, right? The error comes when the planner tries > to convert that string back to OID form. We fixed this in 7.4 by > modifying the way that pg_statistic stores data values, so that no > conversion needs to occur. > > regards, tom lane Well there you go then... trust me to run into some obscure bug! I kept asking how it was possible to get the function oid via just the function name, and nobody pointed out what the undelying data type of pg_operator.oprcode is. In that case you can use the subselect approach that I originally suggested and you will find that it actually works. That is replace column 'po.proname as operproc,' with '(SELECT po.proname FROM pg_proc po WHERE po.oid=op.oprcode) as operproc,' and obviously remove the associated join statment and repeat this for the other two columns: pj.proname as joinproc and pr.proname as restrproc. Regards Donald Fraser.