pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kulmacet101@kulmacet.com
To: Andrew McMillan <andrew@morphoss.com>
Cc: pgsql-php@postgresql.org
Subject: Re: You might need to add explicit type casts.
Date: Sun, 28 Dec 2008 22:17:14 -0600 (CST)
Message-ID: <13f61b6746f3518943cc921d039e9b70.squirrel@webmail.kulmacet.com> (raw)
In-Reply-To: <49584E7C.6090409@kulmacet.com>
References: <49584E7C.6090409@kulmacet.com>

Thank you for the quick response.

I also found that the WHERE statements were not properly quoted, a 101
mistake.

WHERE id = 469 => WHERE id = '469'

The update seems to be working as expected.

kulmacet

> 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.
> ------------------------------------------------------------------------
>
>
>





view thread (4+ messages)  latest in thread

Message-ID: <13f61b6746f3518943cc921d039e9b70.squirrel@webmail.kulmacet.com>
Permalink:  ../13f61b6746f3518943cc921d039e9b70.squirrel@webmail.kulmacet.com/
Also on:    postgresql.org/message-id/13f61b6746f3518943cc921d039e9b70.squirrel@webmail.kulmacet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: kulmacet101@kulmacet.com, andrew@morphoss.com
  Subject: Re: You might need to add explicit type casts.
  In-Reply-To: <13f61b6746f3518943cc921d039e9b70.squirrel@webmail.kulmacet.com>
  References: <49584E7C.6090409@kulmacet.com> <13f61b6746f3518943cc921d039e9b70.squirrel@webmail.kulmacet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox