Re: proposal: simple date constructor from numeric values

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: proposal: simple date constructor from numeric values
Дата
Msg-id 51D1E98D.9040309@gmx.net
обсуждение исходный текст
Ответ на Re: proposal: simple date constructor from numeric values  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: proposal: simple date constructor from numeric values  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: proposal: simple date constructor from numeric values  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On 7/1/13 3:47 AM, Pavel Stehule wrote:
> and it is a part of our ToDo: "Add function to allow the creation of
> timestamps using parameters"
> 
> so we can have a functions with signatures

I would just name them date(...), time(...), etc.

> CREATE OR REPLACE FUNCTION construct_date(year int, month int DEFAULT
> 1, day int DEFAULT 1) RETURNS date;

I would not use default values for this one.

> CREATE OR REPLACE FUNCTION construct_time(hour int DEFAULT 0, mi int
> DEFAULT 0, sec int DEFAULT 0, ms float DEFAULT 0.0);

If we are using integer datetime storage, we shouldn't use floats to
construct them.




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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Bugfix and new feature for PGXS
Следующее
От: Robins Tharakan
Дата:
Сообщение: Re: Add regression tests for DISCARD