Re: Ignored PostgreSQL SET command

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: "Patrick Dunford" <pdunford(dot)webs(at)clear(dot)net(dot)nz>
Cc: pgsql-hackers(at)postgresql(dot)org, php-general(at)lists(dot)php(dot)net
Subject: Re: Ignored PostgreSQL SET command
Date: 2001-01-02 07:59:26
Views: Raw Message | Whole Thread | Download mbox
Lists: pgsql-hackers

"Patrick Dunford" wrote:
>I have a line in a PHP script that looks like this:
> $set=pg_exec($dbconn, "SET DATESTYLE TO 'European'"); //Set date format
>Since my ISP updated their server, this appears to be ignored as pgsql
>always returns dates in ISO format.
>1. What is the default format of dates returned that I can ALWAYS rely on?

>From release 7, the default format is ISO: yyyy-mm-dd

>2. Why is the command ignored?

European has no meaning with the ISO datestyle.

To get normal European dates, do this SET command:

SET DATESTYLE TO 'Postgres,European'

Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
"Verily, verily, I say unto you, He that heareth my
word, and believeth on him that sent me, hath
everlasting life, and shall not come into
condemnation; but is passed from death unto life."
John 5:24

Browse pgsql-hackers by date

  From Date Subject
Next Message Alfred Perlstein 2001-01-02 08:02:31 Re: Assuming that TAS() will succeed the first time is verboten
Previous Message Bruce Momjian 2001-01-02 07:59:20 Re: Assuming that TAS() will succeed the first time is verboten