Re: display to_timestamp in quotas or convert to char ?

Поиск
Список
Период
Сортировка
От Igor Neyman
Тема Re: display to_timestamp in quotas or convert to char ?
Дата
Msg-id A76B25F2823E954C9E45E32FA49D70ECCD4524EF@mail.corp.perceptron.com
обсуждение исходный текст
Ответ на RE: display to_timestamp in quotas or convert to char ?  (czezz <czezz@o2.pl>)
Список 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 по дате отправления:

Предыдущее
От: czezz
Дата:
Сообщение: RE: display to_timestamp in quotas or convert to char ?
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: display to_timestamp in quotas or convert to char ?