pgsql: Fix doc patch --- pg_options_to_table() returns "setof record".

Поиск
Список
Период
Сортировка
Искать

pgsql: Fix doc patch --- pg_options_to_table() returns "setof record".

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Fix doc patch --- pg_options_to_table() returns "setof record".

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/86434afb11093ba4e2893b717858d8ce790f3e2e

Modified Files
--------------
doc/src/sgml/func.sgml |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

Re: pgsql: Fix doc patch --- pg_options_to_table() returns "setof record".

От:
Andrew Dunstan <andrew@dunslane.net>
Дата:


On 02/26/2011 12:27 PM, Bruce Momjian wrote:
> Fix doc patch --- pg_options_to_table() returns "setof record".

This doesn't strike me as terribly helpful. Why don't we document what 
sort of records it returns, since we know perfectly well?:

andrew=# \df pg_options_to_table
                                                         List of functions
    Schema   |        Name         | Result data type 
|                        Argument data types                        |  Type
------------+---------------------+------------------+-------------------------------------------------------------------+--------
  pg_catalog | pg_options_to_table | SETOF record     | options_array 
text[], OUT option_name text, OUT option_value text | normal
(1 row)


cheers

andrew


Re: pgsql: Fix doc patch --- pg_options_to_table() returns "setof record".

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Andrew Dunstan wrote:
> 
> 
> On 02/26/2011 12:27 PM, Bruce Momjian wrote:
> > Fix doc patch --- pg_options_to_table() returns "setof record".
> 
> This doesn't strike me as terribly helpful. Why don't we document what 
> sort of records it returns, since we know perfectly well?:
> 
> andrew=# \df pg_options_to_table
>                                                          List of functions
>     Schema   |        Name         | Result data type 
> |                        Argument data types                        |  Type
> ------------+---------------------+------------------+-------------------------------------------------------------------+--------
>   pg_catalog | pg_options_to_table | SETOF record     | options_array 
> text[], OUT option_name text, OUT option_value text | normal
> (1 row)

Well, other functions don't mention what they return either so I tried
to be consistent.  The mention below does explain their meaning, as does
the text next to it.

Should we fix them all?  I thought that column was just for data types.

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

Re: pgsql: Fix doc patch --- pg_options_to_table() returns "setof record".

От:
Andrew Dunstan <andrew@dunslane.net>
Дата:


On 02/26/2011 12:53 PM, Bruce Momjian wrote:
> Andrew Dunstan wrote:
>>
>> On 02/26/2011 12:27 PM, Bruce Momjian wrote:
>>> Fix doc patch --- pg_options_to_table() returns "setof record".
>> This doesn't strike me as terribly helpful. Why don't we document what
>> sort of records it returns, since we know perfectly well?:
>>
>> andrew=# \df pg_options_to_table
>>                                                           List of functions
>>      Schema   |        Name         | Result data type
>> |                        Argument data types                        |  Type
>> ------------+---------------------+------------------+-------------------------------------------------------------------+--------
>>    pg_catalog | pg_options_to_table | SETOF record     | options_array
>> text[], OUT option_name text, OUT option_value text | normal
>> (1 row)
> Well, other functions don't mention what they return either so I tried
> to be consistent.  The mention below does explain their meaning, as does
> the text next to it.

At least the description of pg_get_keywords() gives the names of the 
fields, which I don't see being given for pg_options_to_table(). The 
only others I see in a quick search are ts_debug(), ts_stat(), 
ts_parse() and ts_token_type().

Meanwhile we seem to have lost the online developer docs at 
 :-(

> Should we fix them all?


Possibly.

> I thought that column was just for data types.
>

I don't understand this sentence.

Incidentally, your example would possibly be better written as:

     select (pg_options_to_table(reloptions)).* from pg_class;

cheers

andrew

Re: pgsql: Fix doc patch --- pg_options_to_table() returns "setof record".

От:
Bruce Momjian <bruce@momjian.us>
Дата:
Andrew Dunstan wrote:
> > Well, other functions don't mention what they return either so I tried
> > to be consistent.  The mention below does explain their meaning, as does
> > the text next to it.
> 
> At least the description of pg_get_keywords() gives the names of the 
> fields, which I don't see being given for pg_options_to_table(). The 
> only others I see in a quick search are ts_debug(), ts_stat(), 
> ts_parse() and ts_token_type().

Ah, good point.  I see you were suggesting this in the paragraph below,
which I have done with the attached patch.

> Meanwhile we seem to have lost the online developer docs at 
>  :-(

I fixed that in the patch too.

> > Should we fix them all?
> 
> 
> Possibly.
> 
> > I thought that column was just for data types.
> >
> 
> I don't understand this sentence.

I thought you were suggesting the table column labled "Return Type".  I
see what you wanted now.

> Incidentally, your example would possibly be better written as:
> 
>      select (pg_options_to_table(reloptions)).* from pg_class;

Wow, that looks much better:

	test=> select (pg_options_to_table(reloptions)).* from pg_class;
	         option_name         | option_value
	-----------------------------+--------------
	 autovacuum_freeze_table_age | 10
	(1 row)

Do I want to know how you figured out how to do that?  :-O

-- 
  Bruce Momjian          http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index 9c8e19f..679f856 100644
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
*************** SELECT pg_type_is_visible('myschema.widg
*** 13386,13392 ****
        
         pg_options_to_table(reloptions)
         setof record
!        get the set of storage option name/value pairs</>
        
        
         pg_tablespace_databases(tablespace_oid)
--- 13386,13392 ----
        
         pg_options_to_table(reloptions)
         setof record
!        get the set of storage option name/value pairs
        
        
         pg_tablespace_databases(tablespace_oid)
*************** SELECT pg_type_is_visible('myschema.widg
*** 13484,13491 ****
    
  
    
!    pg_options_to_table returns the set of storage option
!    name/value pairs when passed
     pg_class</>.reloptions</> or
     pg_attribute</>.attoptions</>.
    
--- 13484,13492 ----
    
  
    
!    pg_options_to_table returns the set of storage
!    option name/value pairs
!    (option_name</>/option_value</>) when passed
     pg_class</>.reloptions</> or
     pg_attribute</>.attoptions</>.
    
FAQ