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
> <http://developer.postgresql.org/pgdocs/postgres/index.html> :-(
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 <bruce@momjian.us> 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 ****
<row>
<entry><literal><function>pg_options_to_table(<parameter>reloptions</parameter>)</function></literal></entry>
<entry><type>setof record</type></entry>
! <entry>get the set of storage option name/value pairs</></entry>
</row>
<row>
<entry><literal><function>pg_tablespace_databases(<parameter>tablespace_oid</parameter>)</function></literal></entry>
--- 13386,13392 ----
<row>
<entry><literal><function>pg_options_to_table(<parameter>reloptions</parameter>)</function></literal></entry>
<entry><type>setof record</type></entry>
! <entry>get the set of storage option name/value pairs</entry>
</row>
<row>
<entry><literal><function>pg_tablespace_databases(<parameter>tablespace_oid</parameter>)</function></literal></entry>
*************** SELECT pg_type_is_visible('myschema.widg
*** 13484,13491 ****
</para>
<para>
! <function>pg_options_to_table</function> returns the set of storage option
! name/value pairs when passed
<structname>pg_class</>.<structfield>reloptions</> or
<structname>pg_attribute</>.<structfield>attoptions</>.
</para>
--- 13484,13492 ----
</para>
<para>
! <function>pg_options_to_table</function> returns the set of storage
! option name/value pairs
! (<literal>option_name</>/<literal>option_value</>) when passed
<structname>pg_class</>.<structfield>reloptions</> or
<structname>pg_attribute</>.<structfield>attoptions</>.
</para>