bruce wrote:
> Josh Berkus wrote:
> > 
> > > Right now pg_options_to_table() is not documented.  Should it be?
> > 
> > Yes, I think so.
> 
> Done, with the attached, applied patch.

Oh, here is an example usage:

        test=> select pg_options_to_table(reloptions) from pg_class;
               pg_options_to_table
        ----------------------------------
         (fillfactor,50)
         (autovacuum_freeze_table_age,10)
        (2 rows)

It also works for pg_attribute.attoptions, so I documented that too.
I also fixed the documented return type in my previous patch.

-- 
  Bruce Momjian  <br...@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 edb7795..9c8e19f 100644
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
*************** SELECT pg_type_is_visible('myschema.widg
*** 13385,13392 ****
        </row>
        <row>
         <entry><literal><function>pg_options_to_table(<parameter>reloptions</parameter>)</function></literal></entry>
!        <entry><type>name, option</type></entry>
!        <entry>get the set of option name/value pairs from <structname>pg_class</>.<structfield>reloptions</></entry>
        </row>
        <row>
         <entry><literal><function>pg_tablespace_databases(<parameter>tablespace_oid</parameter>)</function></literal></entry>
--- 13385,13392 ----
        </row>
        <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,13492 ****
    </para>
  
    <para>
!    <function>pg_options_to_table</function> returns the set of option
     name/value pairs when passed
!    <structname>pg_class</>.<structfield>reloptions</>.
    </para>
  
    <para>
--- 13484,13493 ----
    </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>
  
    <para>
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to