Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4F2D764FCBC for ; Mon, 29 Dec 2008 00:13:53 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 50922-08 for ; Mon, 29 Dec 2008 00:13:50 -0400 (AST) X-Greylist: delayed 00:06:18.207046 by SQLgrey-1.7.6 Received: from mail.morphoss.com (hoppy.mcmillan.net.nz [202.78.240.82]) by mail.postgresql.org (Postfix) with ESMTP id 1F7E364FC4C for ; Mon, 29 Dec 2008 00:13:49 -0400 (AST) Received: from [IPv6:2404:130:b055:0:215:afff:fe48:6c48] (unknown [IPv6:2404:130:b055:0:215:afff:fe48:6c48]) by mail.morphoss.com (Postfix) with ESMTPS id AAD1422F8F; Mon, 29 Dec 2008 17:07:27 +1300 (NZDT) Subject: Re: You might need to add explicit type casts. From: Andrew McMillan To: kulmacet101@kulmacet.com Cc: pgsql-php@postgresql.org. In-Reply-To: <9357e6cdeccf06da015ea1534503b877.squirrel@webmail.kulmacet.com> (sfid-20081229_163036_045766_C7AE3F93) References: <493fbfece44a60104d80bcafedc91780.squirrel@webmail.kulmacet.com> <9357e6cdeccf06da015ea1534503b877.squirrel@webmail.kulmacet.com> (sfid-20081229_163036_045766_C7AE3F93) Content-Type: text/plain Date: Mon, 29 Dec 2008 17:07:25 +1300 Message-Id: <1230523645.5932.4.camel@happy.mcmillan.net.nz> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200812/8 X-Sequence-Number: 3942 On Sun, 2008-12-28 at 21:30 -0600, kulmacet101@kulmacet.com wrote: > I have a table running on Linux\Postgresql 8.3.4: > > CREATE TABLE "public"."active_sessions" ( > "id" VARCHAR(11) DEFAULT nextval('id_seq'::regclass) NOT NULL, > "browser_type" VARCHAR(100), > "session_id" VARCHAR(50), > "ip_address" INET, > "username" VARCHAR(50), > "access_time" TIMESTAMP WITHOUT TIME ZONE, > "user_rand" VARCHAR(15), > "user_activity" TIMESTAMP WITHOUT TIME ZONE, > CONSTRAINT "active_sessions_pkey" PRIMARY KEY("id") > ) WITHOUT OIDS; > > I can insert the TIMESTAMP('s) into this table without issue but when I > update the new entry the following error is received: Hi, You need to: UPDATE active_sessions SET access_time = '12/28/2008 8:51:33PM'::timestamp without time zone WHERE id = 469 or alternatively: UPDATE active_sessions SET access_time = current_timestamp::timestamp without time zone WHERE id = 469 I'm surprised that: UPDATE active_sessions SET access_time = current_timestamp WHERE id = 469 doesn't also work fine though - it should cast timestamp => timestamp without time zone without any trouble. Cheers, Andrew. ------------------------------------------------------------------------ andrew (AT) morphoss (DOT) com +64(272)DEBIAN You fill a much-needed gap. ------------------------------------------------------------------------