error: cast the timestam expression

Поиск
Список
Период
Сортировка
Искать

error: cast the timestam expression

От:
friendVU admin <maillist@friendvu.com>
Дата:
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

Re: error: cast the timestam expression

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
friendVU admin  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

Re: error: cast the timestam expression

От:
Michael Glaesemann <grzm@myrealbox.com>
Дата:

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


FAQ