Received: from pcr.ca (www.pcr.ca [207.139.158.13] (may be forged)) by hub.org (8.9.3/8.9.3) with ESMTP id QAA58933 for ; Mon, 31 Jan 2000 16:59:46 -0500 (EST) (envelope-from admin@wtbwts.com) Received: by pcr.ca (Postfix, from userid 1000) id 3D00E1FEC; Mon, 31 Jan 2000 16:59:19 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by pcr.ca (Postfix) with ESMTP id 348541F91 for ; Mon, 31 Jan 2000 16:59:19 +0000 (GMT) Date: Mon, 31 Jan 2000 16:59:19 +0000 (GMT) From: Marc Tardif X-Sender: admin@server.b0x.com To: pgsql-sql@postgresql.org Subject: now() returning int4 Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII I have a table containing an integer field defaulting to now(), which I want to use as the unix timestamp counting the seconds from jan 1 1970. Problem is when I try to perform queries using now(): db=> CREATE TABLE test ( db-> date int default now() db-> ); CREATE db=> SELECT * FROM test WHERE date < now(); ERROR: Unable to identify operator '<' for types 'int4' and 'timestamp' You will have to retype this query using an explicit cast db=> SELECT * FROM test WHERE date::timestamp < now(); bis db=> SELECT * FROM test WHERE date < now()::int4; bis Please let me know how I can get this to work properly, I'm using postgresql 6.5.3. Marc