From qtboyzz@yahoo.com Fri Mar 4 07:34:07 2005 X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8DFFC552D4 for ; Fri, 4 Mar 2005 07:34:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66134-07 for ; Fri, 4 Mar 2005 07:34:03 +0000 (GMT) Received: from web61010.mail.yahoo.com (web61010.mail.yahoo.com [216.155.196.99]) by svr1.postgresql.org (Postfix) with SMTP id 5B5D452A60 for ; Fri, 4 Mar 2005 07:34:02 +0000 (GMT) Received: (qmail 39233 invoked by uid 60001); 4 Mar 2005 07:34:02 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=TSEP6yNlV7fKXwl+t8q2/9Th0kDL4du6ESo9xJIexsl1zB8ePnmNkX2NlfTHapp/j38IZvR3x2nDHiZ27sSkhhjQcgTjdFNzkskzHyzYiNGG9rUB6S6N3duHDNku5lOpHwQ+I8zm/I8wS7b+wHemM/arpVFkQKFuFILHTLkc6+c= ; Message-ID: <20050304073402.39231.qmail@web61010.mail.yahoo.com> Received: from [68.120.71.7] by web61010.mail.yahoo.com via HTTP; Thu, 03 Mar 2005 23:34:02 PST Date: Thu, 3 Mar 2005 23:34:02 -0800 (PST) From: b t Subject: how to parse an proargtypes array? To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1607439953-1109921642=:38817" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.266 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_20_30, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200503/6 X-Sequence-Number: 5335 --0-1607439953-1109921642=:38817 Content-Type: text/plain; charset=us-ascii Hi, first off all thank to the people that took the time to reply to my message, Unfortunately I do have another question to ask: I'm trying to find out all the argument type that a user-defined function required, I used this query, select proargtypes from pg_proc where proname = 'add_movie'; but it gives me an oidvector array 1043 23 1043 1043 1043 1015 1015 1015 1182 1015, is there a query to parse this and give me a list of type. thanks -brian --------------------------------- Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web --0-1607439953-1109921642=:38817 Content-Type: text/html; charset=us-ascii
Hi, first off all thank to the people that took the time to reply to my message,
Unfortunately I do have another question to ask:
 
I'm trying to find out all the argument type that a user-defined function required, I used this query, select proargtypes from pg_proc where proname = 'add_movie'; but it gives me an oidvector array 1043 23 1043 1043 1043 1015 1015 1015 1182 1015, is there a query to parse this and give me a list of type.
thanks
-brian


Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web --0-1607439953-1109921642=:38817-- From tgl@sss.pgh.pa.us Fri Mar 4 15:16:49 2005 X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C49915526B for ; Fri, 4 Mar 2005 15:16:49 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91963-03 for ; Fri, 4 Mar 2005 15:16:42 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id EAAD95513E for ; Fri, 4 Mar 2005 15:16:41 +0000 (GMT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id j24FGkcT027426; Fri, 4 Mar 2005 10:16:46 -0500 (EST) To: b t Cc: pgsql-interfaces@postgresql.org Subject: Re: how to parse an proargtypes array? In-reply-to: <20050304073402.39231.qmail@web61010.mail.yahoo.com> References: <20050304073402.39231.qmail@web61010.mail.yahoo.com> Comments: In-reply-to b t message dated "Thu, 03 Mar 2005 23:34:02 -0800" Date: Fri, 04 Mar 2005 10:16:46 -0500 Message-ID: <27425.1109949406@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/8 X-Sequence-Number: 5337 b t writes: > I'm trying to find out all the argument type that a user-defined function required, I used this query, select proargtypes from pg_proc where proname = 'add_movie'; but it gives me an oidvector array 1043 23 1043 1043 1043 1015 1015 1015 1182 1015, is there a query to parse this and give me a list of type. Perhaps the regprocedure output converter will help you. Forget proargtypes, just cast the function's OID to regprocedure. If you really want to deal with the individual function argument type OIDs, regtype would help with converting those to useful text; or see format_type(). regards, tom lane From qtboyzz@yahoo.com Fri Mar 4 18:12:46 2005 X-Original-To: pgsql-interfaces-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3966154CF5 for ; Fri, 4 Mar 2005 18:12:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42201-07 for ; Fri, 4 Mar 2005 18:12:36 +0000 (GMT) Received: from web61008.mail.yahoo.com (web61008.mail.yahoo.com [216.155.196.97]) by svr1.postgresql.org (Postfix) with SMTP id 90A5A54E1E for ; Fri, 4 Mar 2005 18:12:35 +0000 (GMT) Received: (qmail 66456 invoked by uid 60001); 4 Mar 2005 18:12:35 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=Fe8OBJIBO0F0YUXbR7/G5p6s+D79f2sSj7zVcW2rj15/4Xo9BJ8ftC2sxgsShSVC69+qWINSQhQWWagMNhqJJecmOs3bUQyCVg6CdJLOXK/fvQa2tGepvJqXgPt798D5q5ndegsoSQa4C4tdBdkQX+xqSwETRsEsZ60vkYVYQOM= ; Message-ID: <20050304181235.66454.qmail@web61008.mail.yahoo.com> Received: from [68.120.71.7] by web61008.mail.yahoo.com via HTTP; Fri, 04 Mar 2005 10:12:35 PST Date: Fri, 4 Mar 2005 10:12:35 -0800 (PST) From: b t Subject: Fwd: Re: how to parse an proargtypes array? To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-450881992-1109959955=:65079" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.198 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, HTML_20_30, HTML_MESSAGE X-Spam-Level: * X-Archive-Number: 200503/10 X-Sequence-Number: 5339 --0-450881992-1109959955=:65079 Content-Type: multipart/alternative; boundary="0-1704777741-1109959955=:65079" --0-1704777741-1109959955=:65079 Content-Type: text/plain; charset=us-ascii Note: forwarded message attached. --------------------------------- Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web --0-1704777741-1109959955=:65079 Content-Type: text/html; charset=us-ascii


Note: forwarded message attached.


Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web --0-1704777741-1109959955=:65079-- --0-450881992-1109959955=:65079 Content-Type: message/rfc822 Received: from [68.120.71.7] by web61004.mail.yahoo.com via HTTP; Fri, 04 Mar 2005 07:45:24 PST Date: Fri, 4 Mar 2005 07:45:24 -0800 (PST) From: b t Subject: Re: [INTERFACES] how to parse an proargtypes array? To: Tom Lane In-Reply-To: <27425.1109949406@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-508245927-1109951124=:47636" Content-Length: 884 --0-508245927-1109951124=:47636 Content-Type: text/plain; charset=us-ascii Hi Tom, I'm still kink of confuse, how do I use the regprocedure output converter and how do I type cast in sql language. many thanks -brian Tom Lane wrote: b t writes: > I'm trying to find out all the argument type that a user-defined function required, I used this query, select proargtypes from pg_proc where proname = 'add_movie'; but it gives me an oidvector array 1043 23 1043 1043 1043 1015 1015 1015 1182 1015, is there a query to parse this and give me a list of type. Perhaps the regprocedure output converter will help you. Forget proargtypes, just cast the function's OID to regprocedure. If you really want to deal with the individual function argument type OIDs, regtype would help with converting those to useful text; or see format_type(). regards, tom lane --------------------------------- Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web --0-508245927-1109951124=:47636 Content-Type: text/html; charset=us-ascii
Hi Tom, I'm still kink of confuse, how do I use the regprocedure output converter and how do I type cast in sql language.
many thanks
-brian


Tom Lane <tgl@sss.pgh.pa.us> wrote:
b t writes:
> I'm trying to find out all the argument type that a user-defined function required, I used this query, select proargtypes from pg_proc where proname = 'add_movie'; but it gives me an oidvector array 1043 23 1043 1043 1043 1015 1015 1015 1182 1015, is there a query to parse this and give me a list of type.

Perhaps the regprocedure output converter will help you. Forget
proargtypes, just cast the function's OID to regprocedure.

If you really want to deal with the individual function argument type
OIDs, regtype would help with converting those to useful text; or see
format_type().

regards, tom lane


Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web --0-508245927-1109951124=:47636-- --0-450881992-1109959955=:65079--