Re: Change error code for hstore syntax error

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: Sherrylyn Branchaw <sbranchaw(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Change error code for hstore syntax error
Date: 2016-09-28 17:06:38
Message-ID: CA+TgmoZ3yakKdpKGXxu5-LjqthZZpAh7-P_Dweph0Ju_D-LAnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 4, 2016 at 7:15 PM, Marko Tiikkaja <marko(at)joh(dot)to> wrote:
> On 2016-05-09 19:42, Sherrylyn Branchaw wrote:
>>
>> I'm attaching a revised patch; please let me know if there are any other
>> issues before I submit to the commitfest.
>
> I think this is mostly good, but these two should be changed:
>
> errmsg("unexpected end of string: \"%s\"", state->begin)
> errmsg("syntax error at position %d: \"%s\"", ...)
>
> Right now, aside from the error code, these two look like they're reporting
> about an error in the SQL statement itself, and not in an input value for a
> type. I think they should look more like this:
>
> errmsg("invalid input syntax for type hstore: \"%s\"", string),
> errdetail("Unexpected end of input.")
>
> If possible, it might also make sense to provide more information than
> "unexpected end of string". For example: what character were you expecting
> to find, or what were you scanning? I didn't look too closely what exactly
> could be done here. I'll leave that part to you.

Since no revised patch has been forthcoming and the CommitFest is due
to end shortly, I've marked this "Returned with Feedback". Sherrylyn,
please feel free to update the patch and resubmit to the next
CommitFest.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2016-09-28 17:11:11 Re: pg_basebackup stream xlog to tar
Previous Message Robert Haas 2016-09-28 17:04:48 Re: Binary I/O for isn extension