Re: Tightening binary receive functions

Поиск
Список
Период
Сортировка
От James Pye
Тема Re: Tightening binary receive functions
Дата
Msg-id 141ACF36-5214-4A76-9488-13EFDE7BE99C@jwp.name
обсуждение исходный текст
Ответ на Tightening binary receive functions  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Tightening binary receive functions  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
On Aug 31, 2009, at 1:12 AM, Heikki Linnakangas wrote:
> ...


Is the new date_recv() constraint actually correct?

[looking at the "result < 0" part, at least]

src/backend/utils/adt/date.c
...
+       /* Limit to the same range that date_in() accepts. */
+       if (result < 0 || result > JULIAN_MAX)
+               ereport(ERROR,
+                               (errcode 
(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
+                                errmsg("date out of range")));
+
+       PG_RETURN_DATEADT(result); }


postgres=# SELECT date_send('500-01-01'::date); date_send
------------ \xfff7a3e9
(1 row)

...
>>> struct.unpack("!l", b'\xff\xf7\xa3\xe9')
(-547863,)


Perhaps 'result' needs to be adjusted by the postgres epoch for the  
comparison?


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Parsing config files in a directory
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Parsing config files in a directory