Re: Ignored PostgreSQL SET command

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: Ignored PostgreSQL SET command
Дата
Msg-id 3A51877A.E18308CF@alumni.caltech.edu
обсуждение исходный текст
Ответ на Ignored PostgreSQL SET command  ("Patrick Dunford" <pdunford.webs@clear.net.nz>)
Список pgsql-hackers
> 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?

ISO. Or you can start up the backend with a different default.

> 2. Why is the command ignored?

It is not (or, is probably not). The variant "European" affects month
and day ordering when specifying a date or when formatting a date with
the "Postgres" or "SQL" format.

You probably want
 SET DATESTYLE TO 'SQL,European'

but ymmv. Check out the docs for more complete info, specifically the
chapter on data types.
                     - Thomas


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [INTERFACES] Re: PHP and PostgreSQL
Следующее
От: Karel Zak
Дата:
Сообщение: Re: Using Threads?