Support named parameters in information_schema.parameters,
authorTom Lane
Sat, 24 Jan 2004 23:45:13 +0000 (23:45 +0000)
committerTom Lane
Sat, 24 Jan 2004 23:45:13 +0000 (23:45 +0000)
per Dennis Bjorklund.  I did not force initdb for this, but
you'd need to do one to get the improved view.

doc/src/sgml/information_schema.sgml
src/backend/catalog/information_schema.sql

index 9193280ea6c4e47da337c68caef6863b38f3064e..ff7d877c61b97098bd322bb22f8688cb20d1decd 100644 (file)
@@ -1,4 +1,4 @@
-
+
 
 
  The Information Schema
@@ -1823,7 +1823,7 @@ ORDER BY c.ordinal_position;
 
   
    The view parameters contains information about
-   the parameters (arguments) all functions in the current database.
+   the parameters (arguments) of all functions in the current database.
    Only those functions are shown that the current user has access to
    (by way of being the owner or having some privilege).
   
@@ -1875,8 +1875,8 @@ ORDER BY c.ordinal_position;
       parameter_mode
       character_data
       
-       Always IN, meaning input parameter (In the
-       future there might be other parameter modes.)
+       Always IN, meaning input parameter (in the
+       future there might be other parameter modes)
       
      
 
@@ -1895,7 +1895,7 @@ ORDER BY c.ordinal_position;
      
       parameter_name
       sql_identifier
-      Always null, since PostgreSQL does not support named parameters
+      Name of the parameter, or null if the parameter has no name
      
 
      
index db4d79f6de5702763ae511eee42b02e45cb769c6..d9c484b0243e08dff4a41367d5360a338f23d9a7 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright 2003, PostgreSQL Global Development Group
  *
- * $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.21 2003/12/17 22:11:30 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/catalog/information_schema.sql,v 1.22 2004/01/24 23:45:13 tgl Exp $
  */
 
 /*
@@ -703,7 +703,7 @@ CREATE VIEW parameters AS
            CAST('IN' AS character_data) AS parameter_mode,
            CAST('NO' AS character_data) AS is_result,
            CAST('NO' AS character_data) AS as_locator,
-           CAST(null AS sql_identifier) AS parameter_name,
+           CAST(NULLIF(p.proargnames[pos.n], '') AS sql_identifier) AS parameter_name,
            CAST(
              CASE WHEN t.typelem <> 0 AND t.typlen = -1 THEN 'ARRAY'
                   WHEN nt.nspname = 'pg_catalog' THEN format_type(t.oid, null)