Thread: BUG #13771: Clarify length of name for prepared statement and return error.

BUG #13771: Clarify length of name for prepared statement and return error.

From
wcatron@catrondevelopment.com
Date:
The following bug has been logged on the website:

Bug reference:      13771
Logged by:          Weston Catron
Email address:      wcatron@catrondevelopment.com
PostgreSQL version: 9.3.3
Operating system:   linux
Description:

Please clarify in the documentation how long a prepared statement name can
be. I tested it at 63 characters. This was not made clear anywhere and I was
running into issues where the differences were past the 63 character mark
and it was trying to run queries with the wrong statement. It also only
CLIPED it didn't return an error of any kind.

Re: BUG #13771: Clarify length of name for prepared statement and return error.

From
"David G. Johnston"
Date:
On Wednesday, November 11, 2015, <wcatron@catrondevelopment.com> wrote:

> The following bug has been logged on the website:
>
> Bug reference:      13771
> Logged by:          Weston Catron
> Email address:      wcatron@catrondevelopment.com <javascript:;>
> PostgreSQL version: 9.3.3
> Operating system:   linux
> Description:
>
> Please clarify in the documentation how long a prepared statement name can
> be. I tested it at 63 characters. This was not made clear anywhere and I
> was
> running into issues where the differences were past the 63 character mark
> and it was trying to run queries with the wrong statement. It also only
> CLIPED it didn't return an error of any kind.
>
>
>
Documented here.

 http://www.postgresql.org/docs/9.1/static/sql-syntax-lexical.html

It applies to all identifiers (e.g., table names, column names, etc...)

Why it had to be truncated instead of an error I don't know but at this
point backward compatibility is likely going to prevent any change.

David J.

Re: BUG #13771: Clarify length of name for prepared statement and return error.

From
"David G. Johnston"
Date:
On Thu, Nov 12, 2015 at 6:47 AM, Weston Catron <
wcatron@catrondevelopment.com> wrote:

> David,
>
> Okay thank you very much. I guess I didn=E2=80=99t google hard enough to =
find that
> (I did google!). Maybe its worth a note in the documentation for the next
> version in the prepared statements section that the statement name is an
> identifier. It also doesn=E2=80=99t mention in the identifiers section th=
at the
> prepared statement name is an example of an identifier. Basically there=
=E2=80=99s
> no direct or indirect link between the two sections which would make it
> hard to match up the two bits of information. Just my two cents, thanks f=
or
> your help.
>
>
=E2=80=8BPrepared statement identifiers are only special because that is wh=
ere you
ran into the problem.  Neither suggestion adds anything except limited
redundancy.

David J.
=E2=80=8B