public inbox for [email protected]  
help / color / mirror / Atom feed
From: Flavio Henrique Araque Gurgel <[email protected]>
To: [email protected]
Subject: Limitation of prepared statement name
Date: Tue, 28 Aug 2018 16:26:30 +0200
Message-ID: <CAGHTAeOxqeojgvWEuciRvq1xbZYHKK6mGzs=g2rQ8upM3mwVWA@mail.gmail.com> (raw)

Hello all

I just found a limitation in prepared statements names that I didn't know
before and can lead applications to be difficult to debug.

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

However, the documentation for PREPARE says nothing about it
https://www.postgresql.org/docs/10/static/sql-prepare.html

The dangerous situation is that PostgreSQL seems to ignore rigthmost
overflowed characters silently. If we try to prepare another statement with
the same 63 leftmost characters as the first one, we get an error of
duplicate prepared statement name.

Wouldn't it be good to include that information on the prepared statement
doc page? Maybe I should notify this as a general bug so we treat this at
the code level.

Best,
Flavio Gurgel


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]
  Subject: Re: Limitation of prepared statement name
  In-Reply-To: <CAGHTAeOxqeojgvWEuciRvq1xbZYHKK6mGzs=g2rQ8upM3mwVWA@mail.gmail.com>

* 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