Re: display to_timestamp in quotas or convert to char ?

From: Igor Neyman <ineyman(at)perceptron(dot)com>
To: czezz <czezz(at)o2(dot)pl>, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: display to_timestamp in quotas or convert to char ?
Date: 2015-05-05 13:33:35
Message-ID: A76B25F2823E954C9E45E32FA49D70ECCD4524EF@mail.corp.perceptron.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org [mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of czezz
Sent: Tuesday, May 05, 2015 9:24 AM
To: Albe Laurenz
Cc: pgsql-admin(at)postgresql(dot)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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Scott Ribe 2015-05-05 13:56:12 Re: display to_timestamp in quotas or convert to char ?
Previous Message czezz 2015-05-05 13:24:13 RE: display to_timestamp in quotas or convert to char ?