Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Adrian Klaver
On 5/17/22 9:23 AM, John W Higgins wrote: Good Morning, Just create the missing function create function to_date(timestamp with time zone, text) RETURNS text AS    'SELECT to_date($1::text, $2)::text'    LANGUAGE SQL    IMMUTABLE; That is just kicking the can down the road. What the OP

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Thomas Kellerer
gzh schrieb am 17.05.2022 um 17:55: I have had a Perl Website working for 7 years and have had no problems until at the weekend I replace my database server with a newer one. Database server (old): PostgreSQL 8.2 32bit Database server (new): PostgreSQL 9.4 64bit I run following sql in Postgre

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread David G. Johnston
On Tue, May 17, 2022 at 8:55 AM gzh wrote: > --PostgreSQL 9.4 > > --- > > SELECT to_date(now() + '-7day', '-MM-DD'); > > > > > > ERROR: function to_date(timestamp with time zone, unknown) does not ex

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread John W Higgins
Good Morning, On Tue, May 17, 2022 at 8:55 AM gzh wrote: > Hi, > > > > > ERROR: function to_date(timestamp with time zone, unknown) does not exist > > LINE 1: SELECT to_date(now() + '-7day', '-MM-DD') > >

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Tom Lane
gzh writes: > I run following sql in PostgreSQL 8.2, it return my expected result as > ¡®-MM-DD¡¯ format. > --PostgreSQL 8.2 > --- > SELECT to_date(now() + '-7day', '-MM-DD'); TBH, this was poor SQL code in 8.2, and it's poor SQL code now. to_date doesn't take timestamp, an

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread Adrian Klaver
On 5/17/22 08:55, gzh wrote: Hi, I have had a Perl Website working for 7 years and have had no problems until at the weekend I replace my database server with a newer one. Database server (old): PostgreSQL 8.2 32bit Database server (new): PostgreSQL 9.4 64bit You do know 9.4 is 2 years past

TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread gzh
Hi, I have had a Perl Website working for 7 years and have had no problems until at the weekend I replace my database server with a newer one. Database server (old): PostgreSQL 8.2 32bit Database server (new): PostgreSQL 9.4 64bit I run following sql in PostgreSQL 8.2, it return my ex