Unix Technical Forum

error: cast the timestam expression

This is a discussion on error: cast the timestam expression within the pgsql Sql forums, part of the PostgreSQL category; --> When I execute this: "insert into comments ( date_posted ) (select date_published from xyz )" I get : "ERROR: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Sql

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 10:54 AM
friendVU admin
 
Posts: n/a
Default error: cast the timestam expression

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

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:12 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com