pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feederror: cast the timestam expression
3+ messages / 3 participants
[nested] [flat]
* error: cast the timestam expression
@ 2005-01-28 14:55 friendVU admin <maillist@friendvu.com>
0 siblings, 2 replies; 3+ messages in thread
From: friendVU admin @ 2005-01-28 14:55 UTC (permalink / raw)
To: pgsql-sql
When I execute this:
"insert into comments
(
date_posted
)
(select date_published
from xyz
)"
I get :
"ERROR: column "date_posted" is of type timestamp without time zone but
expression is of type text
HINT: You will need to rewrite or cast the expression."
Both dates are of type timesamp!
I searched how to cast, and can't find it.
What is the syntax to cast a timestamp to a timestamp?
tia,
.V
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: error: cast the timestam expression
@ 2005-01-28 15:04 Tom Lane <tgl@sss.pgh.pa.us>
parent: friendVU admin <maillist@friendvu.com>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2005-01-28 15:04 UTC (permalink / raw)
To: friendVU admin <maillist@friendvu.com>; +Cc: pgsql-sql
friendVU admin <maillist@friendvu.com> writes:
> When I execute this:
> "insert into comments
> (
> date_posted
> )
> (select date_published
> from xyz
> )"
> I get :
> "ERROR: column "date_posted" is of type timestamp without time zone but
> expression is of type text
> HINT: You will need to rewrite or cast the expression."
> Both dates are of type timesamp!
I don't think so. Let's see the definitions of the comments and xyz
tables (\d in psql will do).
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: error: cast the timestam expression
@ 2005-01-28 15:04 Michael Glaesemann <grzm@myrealbox.com>
parent: friendVU admin <maillist@friendvu.com>
1 sibling, 0 replies; 3+ messages in thread
From: Michael Glaesemann @ 2005-01-28 15:04 UTC (permalink / raw)
To: friendVU admin <maillist@friendvu.com>; +Cc: pgsql-sql
On Jan 28, 2005, at 23:55, friendVU admin wrote:
> When I execute this:
> "insert into comments
> (
> date_posted
> )
> (select date_published
> from xyz
> )"
>
> I get :
> "ERROR: column "date_posted" is of type timestamp without time zone
> but expression is of type text
> HINT: You will need to rewrite or cast the expression."
>
> Both dates are of type timesamp!
Could you post the output to \d xyz and \d comments from psql?
Michael Glaesemann
grzm myrealbox com
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-01-28 15:04 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-01-28 14:55 error: cast the timestam expression friendVU admin <maillist@friendvu.com>
2005-01-28 15:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-01-28 15:04 ` Michael Glaesemann <grzm@myrealbox.com>
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