public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Flavio Henrique Araque Gurgel <[email protected]>
Cc: [email protected]
Subject: Re: Limitation of prepared statement name
Date: Tue, 28 Aug 2018 12:21:15 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAGHTAeOxqeojgvWEuciRvq1xbZYHKK6mGzs=g2rQ8upM3mwVWA@mail.gmail.com>
References: <CAGHTAeOxqeojgvWEuciRvq1xbZYHKK6mGzs=g2rQ8upM3mwVWA@mail.gmail.com>

Flavio Henrique Araque Gurgel <[email protected]> writes:
> It seems that naming prepared statements is limited to 63 characters as per
> https://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-IDENTIFIERS

Yeah, just like every other SQL identifier in Postgres...

> The dangerous situation is that PostgreSQL seems to ignore rigthmost
> overflowed characters silently.

It's hardly silent:

regression=# prepare foo1234567890123456789012345678901234567890123456789012345678901234567890 as select 1;
NOTICE:  identifier "foo1234567890123456789012345678901234567890123456789012345678901234567890" will be truncated to "foo123456789012345678901234567890123456789012345678901234567890"
PREPARE

> Wouldn't it be good to include that information on the prepared statement
> doc page?

You could as well argue that every single page that describes creating
any sort of object ought to repeat this information.  I doubt that people
would find that to be an improvement.

			regards, tom lane




view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Limitation of prepared statement name
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox