Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YpdKg-0008H5-C5 for pgsql-admin@arkaria.postgresql.org; Tue, 05 May 2015 13:56:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YpdKf-0006Ps-SJ for pgsql-admin@arkaria.postgresql.org; Tue, 05 May 2015 13:56:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YpdKe-0006Pl-PH for pgsql-admin@postgresql.org; Tue, 05 May 2015 13:56:20 +0000 Received: from mailout.easymail.ca ([64.68.201.169]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YpdKb-0000Wu-GG for pgsql-admin@postgresql.org; Tue, 05 May 2015 13:56:19 +0000 Received: from localhost (localhost [127.0.0.1]) by mailout.easymail.ca (Postfix) with ESMTP id EA3E1E3AB; Tue, 5 May 2015 09:56:15 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at mailout.easymail.ca X-Spam-Flag: NO X-Spam-Score: -3.908 X-Spam-Level: X-Spam-Status: No, score=-3.908 required=5 tests=[ALL_TRUSTED=-1.8, AWL=-0.201, BAYES_00=-2.599, DNS_FROM_AHBL_RHSBL=0.692] Received: from mailout.easymail.ca ([127.0.0.1]) by localhost (easymail-mailout.easydns.vpn [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h3Mzi9CNLYEW; Tue, 5 May 2015 09:56:15 -0400 (EDT) Received: from [192.168.2.16] (unknown [8.39.228.5]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailout.easymail.ca (Postfix) with ESMTPSA id 73102E3A9; Tue, 5 May 2015 09:56:15 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: display to_timestamp in quotas or convert to char ? From: Scott Ribe In-Reply-To: <70aed348.7ad50e54.5548c47d.1e1de@o2.pl> Date: Tue, 5 May 2015 07:56:12 -0600 Cc: Albe Laurenz , pgsql-admin@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <22c93a48.7dc1250c.5548946d.f29b0@o2.pl> <70aed348.7ad50e54.5548c47d.1e1de@o2.pl> To: czezz X-Mailer: Apple Mail (2.2098) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org On May 5, 2015, at 7:24 AM, czezz wrote: >=20 > have already tried to convert timestamp to char like you suggested but t= hat lead to another error. >=20 > First, simply execution with NO conversion - to make sure it works like t= hat:=20=20 > Server2=3D# select to_timestamp('2015-05-04 22:13:14.000', 'YYYY/MM/DD-HH= 24:MI:SS.FF3'); > to_timestamp > ------------------------ > 2015-05-04 22:13:14+02 > (1 row) >=20 > Secondly, to_char(): > Server2=3D# 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 n= eed to add explicit type casts. >=20 > 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. --=20 Scott Ribe scott_ribe@elevated-dev.com http://www.elevated-dev.com/ https://www.linkedin.com/in/scottribe/ (303) 722-0567 voice --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin