Re: information_schema.columns changes needed for OLEDB

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: information_schema.columns changes needed for OLEDB
Дата
Msg-id 25003.1244571963@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: information_schema.columns changes needed for OLEDB  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> After gathering that there will probably be some other changes before
> release that will require an initdb (even without catversion bump), and
> after reexamining the issue, I think it's trivial and uncontroversial to
> fix the datetime issues:

For the benefit of anyone else finding this hard to read, I've
reformatted as

*** src/backend/catalog/information_schema.sql.orig    Tue Feb 24 11:10:16 2009
--- src/backend/catalog/information_schema.sql    Tue Jun  9 14:21:37 2009
***************
*** 160,171 ****     RETURNS NULL ON NULL INPUT     AS $$SELECT
!   CASE WHEN $2 = -1 /* default typmod */
!        THEN null        WHEN $1 IN (1083, 1114, 1184, 1266) /* time, timestamp, same + tz */
!        THEN $2        WHEN $1 IN (1186) /* interval */
!        THEN $2 & 65535        ELSE null   END$$; 
--- 160,171 ----     RETURNS NULL ON NULL INPUT     AS $$SELECT
!   CASE WHEN $1 IN (1082) /* date */
!            THEN 0        WHEN $1 IN (1083, 1114, 1184, 1266) /* time, timestamp, same + tz */
!            THEN CASE WHEN $2 = -1 THEN 6 ELSE $2 END        WHEN $1 IN (1186) /* interval */
!            THEN CASE WHEN $2 = -1 THEN 6 ELSE $2 & 65535 END        ELSE null   END$$;

I would suggest coding the inner cases asCASE WHEN $2 < 0 THEN ...default...
since the general practice in the C code is to treat any negative
value as meaning "unspecified".  Otherwise, +1.
        regards, tom lane


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

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: Not quite a security hole in internal_in
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Not quite a security hole in internal_in