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

Reply via email to