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

Re: [ADMIN] Overloading functions that are used by operators.

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Donald Fraser" <demolish(at)cwgsy(dot)net>,"[ADMIN]" <pgsql-admin(at)postgresql(dot)org>,"[pgADMIN]" <pgadmin-support(at)postgresql(dot)org>
Subject: Re: [ADMIN] Overloading functions that are used by operators.
Date: 2003-07-10 15:52:50
Message-ID: 03AF4E498C591348A42FC93DEA9661B83AF171@mail.vale-housing.co.uk (view raw or flat)
Thread:
Lists: pgadmin-supportpgsql-admin

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us] 
> Sent: 10 July 2003 16:38
> To: Dave Page
> Cc: Donald Fraser; [ADMIN]; [pgADMIN]
> Subject: Re: [ADMIN] [pgadmin-support] Overloading functions 
> that are used by operators. 
> 
> 
> "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk> writes:
> > Well I always thought you could overload functions in this way, 
> > however with your example below, although it creates it OK, 
> PostgreSQL 
> > (not
> > pgAdmin) gives the error 'ERROR: There is more than one 
> function named
> > textcat'.
> 
> 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:

postgresql=# create function pg_catalog.textcat(varchar,text)
postgresql-# returns text as 'textcat' language 'internal';
CREATE FUNCTION
postgresql=# SELECT op.oid, op.oprname, pg_get_userbyid(op.oprowner) as
opowner, op.oprkind, op.oprcanhash,
postgresql-#                op.oprleft, op.oprright, lt.typname as
lefttype, rt.typname as righttype, et.typname as resulttype,
postgresql-#                co.oprname as compop, ne.oprname as negop,
lso.oprname as leftsortop, rso.oprname as rightsortop,
postgresql-#                lco.oprname as lscmpop, gco.oprname as
gtcmpop,
postgresql-#                po.proname as operproc, pj.proname as
joinproc, pr.proname as restrproc, description
postgresql-#           FROM pg_operator op
postgresql-#           LEFT OUTER JOIN pg_type lt ON lt.oid=op.oprleft
postgresql-#           LEFT OUTER JOIN pg_type rt ON rt.oid=op.oprright
postgresql-#           JOIN pg_type et on et.oid=op.oprresult
postgresql-#           LEFT OUTER JOIN pg_operator co ON
co.oid=op.oprcom
postgresql-#           LEFT OUTER JOIN pg_operator ne ON
ne.oid=op.oprnegate
postgresql-#           LEFT OUTER JOIN pg_operator lso ON
lso.oid=op.oprlsortop
postgresql-#           LEFT OUTER JOIN pg_operator rso ON
rso.oid=op.oprrsortop
postgresql-#           LEFT OUTER JOIN pg_operator lco ON
lco.oid=op.oprltcmpop
postgresql-#           LEFT OUTER JOIN pg_operator gco ON
gco.oid=op.oprgtcmpop
postgresql-#           JOIN pg_proc po ON po.oid=op.oprcode
postgresql-#           LEFT OUTER JOIN pg_proc pr ON pr.oid=op.oprrest
postgresql-#           LEFT OUTER JOIN pg_proc pj ON pj.oid=op.oprjoin
postgresql-#           LEFT OUTER JOIN pg_description des ON
des.objoid=op.oid;
ERROR:  There is more than one procedure named textcat

Dropping the extra function, or changing the query a little fixes it:

postgresql=# SELECT op.oid, op.oprname, pg_get_userbyid(op.oprowner) as
opowner, op.oprkind, op.oprcanhash,
postgresql-#                op.oprleft, op.oprright, lt.typname as
lefttype, rt.typname as righttype, et.typname as resulttype,
postgresql-#                co.oprname as compop, ne.oprname as negop,
lso.oprname as leftsortop, rso.oprname as rightsortop,
postgresql-#                lco.oprname as lscmpop, gco.oprname as
gtcmpop,
postgresql-#                op.oprcode as operproc, op.oprjoin as
joinproc, op.oprrest as restrproc, description
postgresql-#           FROM pg_operator op
postgresql-#           LEFT OUTER JOIN pg_type lt ON lt.oid=op.oprleft
postgresql-#           LEFT OUTER JOIN pg_type rt ON rt.oid=op.oprright
postgresql-#           JOIN pg_type et on et.oid=op.oprresult
postgresql-#           LEFT OUTER JOIN pg_operator co ON
co.oid=op.oprcom
postgresql-#           LEFT OUTER JOIN pg_operator ne ON
ne.oid=op.oprnegate
postgresql-#           LEFT OUTER JOIN pg_operator lso ON
lso.oid=op.oprlsortop
postgresql-#           LEFT OUTER JOIN pg_operator rso ON
rso.oid=op.oprrsortop
postgresql-#           LEFT OUTER JOIN pg_operator lco ON
lco.oid=op.oprltcmpop
postgresql-#           LEFT OUTER JOIN pg_operator gco ON
gco.oid=op.oprgtcmpop
postgresql-#           LEFT OUTER JOIN pg_description des ON
des.objoid=op.oid;
 oid  | oprname | opowner  | oprkind | oprcanhash | oprleft | oprright |
lefttype ....

Regards, Dave.

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2003-07-10 16:06:35
Subject: Re: [ADMIN] Overloading functions that are used by operators.
Previous:From: scott.marloweDate: 2003-07-10 15:51:43
Subject: Re: Error message using pg_dump with tar format

pgadmin-support by date

Next:From: Tom LaneDate: 2003-07-10 16:06:35
Subject: Re: [ADMIN] Overloading functions that are used by operators.
Previous:From: Tom LaneDate: 2003-07-10 15:37:51
Subject: Re: [ADMIN] Overloading functions that are used by operators.

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