[SQL] Date/Time problem -(((
Hello I am moving from MySQL to Postgres and while converting my sql code I have a lot of problems with this construction: ($ze is current time - 300 secounds): delete from onlineuser where datum < FROM_UNIXTIME($ze) Is there any Date/Time function in PGSQL? I want as shown in this example delete entries older than 300 secounds. I postet to the list because I have found no solution in the tutorials and search-engine (maybe searched with wrong words?) It would be great if someone could help me / point me to the right way... -- Boris
[SQL] Re[2]: Date/Time problem -(((
Hello Francis, Tuesday, January 02, 2001, 3:23:49 AM, you wrote: FS> Hi Boris, FS> I know Kaare Rasmussen posted a URL to the online documentation already, FS> but this might be a direct solution to your problem: FS> DELETE FROM onlineuser WHERE datum < ('now'::datetime - '5 FS> minutes'::interval); FS> Hope this helps FS> Francis Solomon Yes this helps me a lot thanks -- Boris
[SQL] Use select and update together
Hi, this is my first on this list. I can't understand where my problem in PG 8.4. CREATE TABLE tbl( KEY int, val int); Update query like: UPDATE tbl SET val = 1 WHERE KEY = any('{0,1,2,3,4,5}'::int[]) returning key; work well. But any try to wrap it in select query like: SELECT ( UPDATE tbl SET val = 1 WHERE KEY = any('{0,1,2,3,4,5}'::int[]) returning key ); cause syntax error. Is any query of such type (update warped into select) is possible? Best regards, Kuzikov Borys -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
[SQL] select xpath ...
hi all, I've inserted xml file : xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> zz .. to a table: CREATE TABLE "temp".tempxml ( record xml ) I can get it using: select * from temp.tempxml but, I can't get any values using xpath. ex: select (xpath('/document/title/text()', record ))[1] from temp.tempxml am I doing it right? thanks. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
Re: [SQL] select xpath ...
On 09/19/2011 10:49 AM, Rob Sargent wrote: Having a name space in the doc requires it's usage in the query. yeah, I got it... I was using wrong one... thanks. On 09/17/2011 11:48 AM, boris wrote: hi all, I've inserted xml file : http://www.w3.org/2001/XMLSchema-instance";> zz .. to a table: CREATE TABLE "temp".tempxml ( record xml ) I can get it using: select * from temp.tempxml but, I can't get any values using xpath. ex: select (xpath('/document/title/text()', record ))[1] from temp.tempxml am I doing it right? thanks. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql
[SQL] Please include hier-patch in next PostgreSQL version
Hello! I want to say that it would be fantastic when you include the Oracle like "CONNECT BY" patch (see gppl.terminal.ru/readme.html) in the next version of PostgreSQL. It is very usefull for people that have to handle such kind of hierarchical data. -- Dipl. Inform. Boris Klug, control IT GmbH, Germany ---(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