X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 9073ED1EC35 for ; Fri, 7 May 2004 20:39:58 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 73468-03 for ; Fri, 7 May 2004 20:39:40 -0300 (ADT) Received: from wayreth.luchs.at (wayreth.luchs.at [195.230.42.195]) by svr1.postgresql.org (Postfix) with ESMTP id DA75FD1EEA2 for ; Fri, 7 May 2004 20:39:35 -0300 (ADT) Received: from weyoun (spaceman.foo.at [213.47.56.254]) by wayreth.luchs.at (8.12.11/8.12.9) with ESMTP id i47NdbYT007744 for ; Sat, 8 May 2004 01:39:37 +0200 Content-Type: text/plain; charset="iso-8859-1" From: Stefan Weiss Organization: Foo Orbital Operations To: Subject: Re: \df Date: Sat, 8 May 2004 01:39:35 +0200 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200405080139.35083.spaceman@foo.at> X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.1 tagged_above=0.0 required=5.0 tests=RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200405/78 X-Sequence-Number: 17792 On Saturday, 08 May 2004 01:15, Jie Liang wrote: > What sql statement equal to \df function_name > I want to know the result data type for a given function within plpgsql. Try the -E switch for pgsql: spaceman@weyoun:~ $ psql -E Welcome to psql 7.4.2, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help on internal slash commands \g or terminate with semicolon to execute query \q to quit spaceman=# \df alt_to_iso ********* QUERY ********** SELECT CASE WHEN p.proretset THEN 'setof ' ELSE '' END || pg_catalog.format_type(p.prorettype, NULL) as "Result data type", n.nspname as "Schema", p.proname as "Name", pg_catalog.oidvectortypes(p.proargtypes) as "Argument data types" FROM pg_catalog.pg_proc p LEFT JOIN pg_catalog.pg_namespace n ON n.oid = p.pronamespace WHERE p.prorettype <> 'pg_catalog.cstring'::pg_catalog.regtype AND p.proargtypes[0] <> 'pg_catalog.cstring'::pg_catalog.regtype AND NOT p.proisagg AND pg_catalog.pg_function_is_visible(p.oid) AND p.proname ~ '^alt_to_iso$' ORDER BY 2, 3, 1, 4; ************************** List of functions Result data type | Schema | Name | Argument data types ------------------+------------+------------+--------------------------------------------- void | pg_catalog | alt_to_iso | integer, integer, cstring, ... (1 row) HTH, stefan weiss