[PATCHES] Unix timestamp -> timestamp, per Tom Lane :)
Folks, 'nother one. Thanks very much, Tom! :) Cheers, D -- David Fetter [EMAIL PROTECTED] http://fetter.org/ phone: +1 510 893 6100cell: +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 - 1.180 --- func.sgml 4 Dec 2003 16:59:32 - *** *** 5006,5009 --- 5006,5018 SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours'); Result: 442800 + + + To convert a UNIX timestamp (number of seconds since + 1970-01-01 00:00:00-00) into a timestamp, you can + write: + + + SELECT 'epoch'::timestampz + 1070430858 * '1 second'::interval; + Result: 2003-12-03 05:54:18 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.sgml30 Nov 2003 05:45:22 - 1.32 --- plpgsql.sgml4 Dec 2003 16:59:34 - *** *** 1033,1036 --- 1033,1050 + + + Another example, which returns true if user foo is in group bar: + + 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'; + + + ---(end of broadcast)--- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faqs/FAQ.html
[PATCHES] minor SGML fix
A GUC variable in runtime.sgml had the wrong markup -- this patch fixes that, and makes a few other tiny SGML improvements. -Neil Index: doc/src/sgml/runtime.sgml === RCS file: /var/lib/cvs/pgsql-server/doc/src/sgml/runtime.sgml,v retrieving revision 1.224 diff -c -r1.224 runtime.sgml *** doc/src/sgml/runtime.sgml 1 Dec 2003 22:07:56 - 1.224 --- doc/src/sgml/runtime.sgml 4 Dec 2003 18:40:57 - *** *** 830,836 server. The default is typically 1000, but may be less if your kernel settings will not support it (as determined during initdb). Each buffer is 8192 bytes, unless a ! different value of BLCKSZ was chosen when building the server. This setting must be at least 16, as well as at least twice the value of max_connections; however, settings significantly higher than the minimum are --- 830,836 server. The default is typically 1000, but may be less if your kernel settings will not support it (as determined during initdb). Each buffer is 8192 bytes, unless a ! different value of BLCKSZ was chosen when building the server. This setting must be at least 16, as well as at least twice the value of max_connections; however, settings significantly higher than the minimum are *** *** 2538,2548 Turns on various assertion checks. This is a debugging aid. If you are experiencing strange problems or crashes you might want to turn this on, as it might expose programming mistakes. To use ! this option, the macro USE_ASSERT_CHECKING must be defined when PostgreSQL is built (accomplished by the configure option --enable-cassert). Note that ! DEBUG_ASSERTIONS defaults to on if PostgreSQL has been built with assertions enabled. --- 2538,2548 Turns on various assertion checks. This is a debugging aid. If you are experiencing strange problems or crashes you might want to turn this on, as it might expose programming mistakes. To use ! this option, the macro USE_ASSERT_CHECKING must be defined when PostgreSQL is built (accomplished by the configure option --enable-cassert). Note that ! debug_assertions defaults to on if PostgreSQL has been built with assertions enabled. ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
Re: [PATCHES] Unix timestamp -> timestamp, per Tom Lane :)
David Fetter writes: > Folks, > > 'nother one. Thanks very much, Tom! :) > > Cheers, > D Can you adjust the patch so that it contains only the relevant parts and creates valid DocBook? ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
Re: [PATCHES] minor SGML fix
Neil Conway writes: > A GUC variable in runtime.sgml had the wrong markup -- this patch > fixes that, and makes a few other tiny SGML improvements. I've installed this patch, but I've used instead of for C preprocessor macros, to be consistent with other usage. ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster
Re: [PATCHES] Unix timestamp -> timestamp, per Tom Lane :)
On Thu, Dec 04, 2003 at 10:21:46PM +0100, Peter Eisentraut wrote: > David Fetter writes: > > > Folks, > > > > 'nother one. Thanks very much, Tom! :) > > > > Cheers, > > D > > Can you adjust the patch so that it contains only the relevant parts > and creates valid DocBook? OK. How do I test this? After "make && make check" at the top level, there is no html or pdf. Cheers, D -- David Fetter [EMAIL PROTECTED] http://fetter.org/ phone: +1 510 893 6100cell: +1 415 235 3778 ---(end of broadcast)--- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
Re: [PATCHES] Unix timestamp -> timestamp, per Tom Lane :)
David Fetter wrote: OK. How do I test this? After "make && make check" at the top level, there is no html or pdf. first do: cd doc/src/sgml See: http://developer.postgresql.org/docs/postgres/docguide-build.html HTH, Joe ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly
[PATCHES] YA Doc patch
Kind people, I hope this one actually does what Tom said. It appears to work :) Cheers, D -- David Fetter [EMAIL PROTECTED] http://fetter.org/ phone: +1 510 893 6100cell: +1 415 235 3778 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 - 1.180 --- func.sgml 4 Dec 2003 22:16:52 - *** *** 4997,5001 number of seconds since 1970-01-01 00:00:00-00 (can be negative); for interval values, the total number ! of seconds in the interval --- 4997,5002 number of seconds since 1970-01-01 00:00:00-00 (can be negative); for interval values, the total number ! of seconds in the interval. The third example shows how to ! convert number of seconds since EPOCH into a timestamp. *** *** 5006,5009 --- 5007,5013 SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3 hours'); Result: 442800 + + SELECT 'epoch'::timestamptz + 1070430858 * '1 second'::interval; + Result: 2003-12-02 21:54:18-08 ---(end of broadcast)--- TIP 7: don't forget to increase your free space map settings
