Re: new function for tsquery creartion - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: new function for tsquery creartion
Date
Msg-id 20180328092115.GA32581@e733.localdomain
Whole thread Raw
In response to Re: new function for tsquery creartion  (Dmitry Ivanov <d.ivanov@postgrespro.ru>)
Responses Re: new function for tsquery creartion
List pgsql-hackers
Hello Dmitry,

> A few gotchas:
>
> I haven't touched gettoken_tsvector() yet. As a result, the following
> queries produce errors:
>
> select websearch_to_tsquery('simple', '''');
> ERROR:  syntax error in tsquery: "'"
>
> select websearch_to_tsquery('simple', '\');
> ERROR:  there is no escaped character: "\"
>
> Maybe there's more. The question is: should we fix those, or it's fine as it
> is? I don't have a strong opinion about this.

It doesn't sound right to me to accept any input as a general rule but
sometimes return errors nevertheless. That API would be complicated for
the users. Thus I suggest to accept any garbage and try our best to
interpret it.

--
Best regards,
Aleksander Alekseev

Attachment

pgsql-hackers by date:

Previous
From: Tatsuo Ishii
Date:
Subject: Re: Proposal: http2 wire format
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] path toward faster partition pruning