pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Ribe <scott_ribe@elevated-dev.com>
To: czezz <czezz@o2.pl>
Cc: Albe Laurenz <laurenz.albe@wien.gv.at>
Cc: pgsql-admin@postgresql.org
Subject: Re: display to_timestamp in quotas or convert to char ?
Date: Tue, 5 May 2015 07:56:12 -0600
Message-ID: <FA3EDC66-B5A8-461F-8EAD-48124674C7BB@elevated-dev.com> (raw)
In-Reply-To: <70aed348.7ad50e54.5548c47d.1e1de@o2.pl>
References: <22c93a48.7dc1250c.5548946d.f29b0@o2.pl>
	<A737B7A37273E048B164557ADEF4A58B365FC46A@ntex2010a.host.magwien.gv.at>
	<70aed348.7ad50e54.5548c47d.1e1de@o2.pl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

On May 5, 2015, at 7:24 AM, czezz <czezz@o2.pl> wrote:
> 
>  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.

WHY are you still trying to convert to_char??? Convert the varchar field to_timestamp and be done with it.

-- 
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
https://www.linkedin.com/in/scottribe/
(303) 722-0567 voice







-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (11+ messages)  latest in thread

Message-ID: <FA3EDC66-B5A8-461F-8EAD-48124674C7BB@elevated-dev.com>
Permalink:  ../FA3EDC66-B5A8-461F-8EAD-48124674C7BB@elevated-dev.com/
Also on:    postgresql.org/message-id/FA3EDC66-B5A8-461F-8EAD-48124674C7BB@elevated-dev.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: scott_ribe@elevated-dev.com, czezz@o2.pl, laurenz.albe@wien.gv.at
  Subject: Re: display to_timestamp in quotas or convert to char ?
  In-Reply-To: <FA3EDC66-B5A8-461F-8EAD-48124674C7BB@elevated-dev.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox