Re: display to_timestamp in quotas or convert to char ? - Mailing list pgsql-admin

From Igor Neyman
Subject Re: display to_timestamp in quotas or convert to char ?
Date
Msg-id A76B25F2823E954C9E45E32FA49D70ECCD4524EF@mail.corp.perceptron.com
Whole thread Raw
In response to RE: display to_timestamp in quotas or convert to char ?  (czezz <czezz@o2.pl>)
List pgsql-admin

-----Original Message-----
From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org] On Behalf Of czezz
Sent: Tuesday, May 05, 2015 9:24 AM
To: Albe Laurenz
Cc: pgsql-admin@postgresql.org
Subject: RE: [ADMIN]display to_timestamp in quotas or convert to char ?

Hi, thank you for reply.
I have already tried to convert timestamp to char like you suggested but that lead to another error.

First, simply execution with NO conversion - to make sure it works like that:  
Server2=# select to_timestamp('2015-05-04 22:13:14.000', 'YYYY/MM/DD-HH24:MI:SS.FF3');
      to_timestamp
------------------------
 2015-05-04 22:13:14+02
(1 row)

Secondly, to_char():
Server2=# select to_char(to_timestamp('2015-05-04 22:13:14.000', 'YYYY/MM/DD-HH24:MI:SS.FF3'));
ERROR:  function to_char(timestamp with time zone) does not exist LINE 1: select to_char(to_timestamp('2015-05-04
22:13:14.000','YYYY...
 
               ^
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.

And this HINT seems to be odd.

BR,
czezz


There is nothing odd about HINT.
to_char(timestamp, text) requires second parameter: format, which you didn't provide.

Regards,
Igor Neyman


pgsql-admin by date:

Previous
From: czezz
Date:
Subject: RE: display to_timestamp in quotas or convert to char ?
Next
From: Scott Ribe
Date:
Subject: Re: display to_timestamp in quotas or convert to char ?