Folks,

'nother one.  Thanks very much, Tom! :)

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 510 893 6100    cell: +1 415 235 3778
? func_unixtimestamp.patch
Index: func.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/func.sgml,v
retrieving revision 1.180
diff -2 -c -r1.180 func.sgml
*** func.sgml   29 Nov 2003 19:51:37 -0000      1.180
--- func.sgml   4 Dec 2003 16:59:32 -0000
***************
*** 5006,5009 ****
--- 5006,5018 ----
  SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours');
  <lineannotation>Result: </lineannotation><computeroutput>442800</computeroutput>
+ 
+        <para>
+         To convert a UNIX timestamp (number of seconds since
+         1970-01-01 00:00:00-00) into a <type>timestamp</type>, you can
+         write:
+        </para>
+ 
+ SELECT 'epoch'::timestampz + 1070430858 * '1 second'::interval;
+ <lineannotation>Result: </lineannotation><computeroutput>2003-12-03 
05:54:18</computeroutput>
  </screen>
        </listitem>
Index: plpgsql.sgml
===================================================================
RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/plpgsql.sgml,v
retrieving revision 1.32
diff -2 -c -r1.32 plpgsql.sgml
*** plpgsql.sgml        30 Nov 2003 05:45:22 -0000      1.32
--- plpgsql.sgml        4 Dec 2003 16:59:34 -0000
***************
*** 1033,1036 ****
--- 1033,1050 ----
  </programlisting>
      </para>
+ 
+     <para>
+      Another example, which returns true if user foo is in group bar:
+ <programlisting>
+ PERFORM *
+ FROM 
+   pg_catalog.pg_user u
+ , pg_catalog.pg_group g
+ WHERE u.usesysid = ANY(g.grolist)
+ AND u.usename='foo'
+ AND g.groname='bar';
+ </programlisting>
+     </para>
+ 
     </sect2>
     
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faqs/FAQ.html

Reply via email to