Re: BUG #1518: Conversions to (undocumented) SQL year-month

Поиск
Список
Период
Сортировка
От Roy Badami
Тема Re: BUG #1518: Conversions to (undocumented) SQL year-month
Дата
Msg-id 16961.63851.854455.832219@giles.gnomon.org.uk
обсуждение исходный текст
Ответ на Re: BUG #1518: Conversions to (undocumented) SQL year-month  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-bugs
Bruce> What happens if you store '13 months' into an interval
    Bruce> column that is YEAR TO MONTH?  Does extract MONTH return 1
    Bruce> or 13?

In  standard SQL  the  MONTH field  of  INTERVAL YEAR  TO MONTH  can't
contain a value  greater than 11.  Though I  don't immediately see how
you'd go about  storing 13 in the month field.   I don't think there's
an analogue of EXTRACT that allows you to set fields, is there?

    Bruce> The lack of complaints all these years perhaps means people
    Bruce> either don't care or accept the PG behavior.

To be honest, I don't really care :-)

I try to write my SQL in as standard a way as possible, in case I
later want to port to another database...

I would be perfectly happy for

    INTERVAL '1' MONTH

to be a syntax error.  I just don't like the fact that it gives me a
zero interval.

Taking out the ISO support from the parser is a valid fix as far as
I'm concerned (though actually making it do the ISO thing would
obviously be nicer)

     -roy

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #1518: Conversions to (undocumented) SQL year-month and
Следующее
От: Roy Badami
Дата:
Сообщение: Re: BUG #1517: SQL interval syntax is accepted by the parser,