Best practice for specifying an interval

Поиск
Список
Период
Сортировка
От Mark Morgan Lloyd
Тема Best practice for specifying an interval
Дата
Msg-id fd7u9j$v7n$1@pye-srv-01.telemetry.co.uk
обсуждение исходный текст
Ответы Re: Best practice for specifying an interval  ("Rodrigo De Le�" <rdeleonp@gmail.com>)
Список pgsql-general
I notice that section 9.9 of the manual has examples including both HOUR and
HOURS, but the list of reserved words includes only the former.

Am I correct in assuming that

    select time '11:00' - interval '3 hour';

is preferred to

    select time '11:00' - interval '3 hours';


In a similar vein, are fractional hours best specified as

    select time '11:00' - interval '3 hour 45 minute';

or as

    select time '11:00' - interval '3.75 hour';

or with the interval converted to an integer number of minutes?

All these forms appear to work. I've got no intention of jumping ship but am
curious as to the favoured and most portable style.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

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

Предыдущее
От: "Ashish Karalkar"
Дата:
Сообщение: Re: Why the ERROR: duplicate key violates unique constraint "master_pkey" is raised? - Is this a Bug?
Следующее
От: "Rajaram J"
Дата:
Сообщение: Extra messages on my console.