Change error code for hstore syntax error

Поиск
Список
Период
Сортировка
От Sherrylyn Branchaw
Тема Change error code for hstore syntax error
Дата
Msg-id CAB_myF638pgddX4TesZP8W6rGErLK9B+MXUxF_m+sCB_ijaJZQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Change error code for hstore syntax error  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
The hstore module uses elog() to default to ERRCODE_INTERNAL_ERROR (SQLSTATE XX000) when the error message reads "Syntax error near '%c' at position %d".

I propose to switch to ereport() to return ERRCODE_SYNTAX_ERROR (SQLSTATE 42601), on the grounds that it's more transparent. It took me longer to figure out what error code was being returned than to write both the patch and my originally intended function using the patch.

I also propose to raise the same error code for "Unexpected end of string" in hstore, since it serves the same purpose, at least in my mind: differentiating between valid and invalid hstore syntax. 

Any objections to my submitting the attached patch to the September commitfest?
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATH] Correct negative/zero year in to_date/to_timestamp
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Change error code for hstore syntax error