Limitation of prepared statement name - Mailing list pgsql-docs

From Flavio Henrique Araque Gurgel
Subject Limitation of prepared statement name
Date
Msg-id CAGHTAeOxqeojgvWEuciRvq1xbZYHKK6mGzs=g2rQ8upM3mwVWA@mail.gmail.com
Whole thread Raw
Responses Re: Limitation of prepared statement name
List pgsql-docs
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

pgsql-docs by date:

Previous
From: Justin Pryzby
Date:
Subject: remove duplicated words in comments .. across lines
Next
From: PG Doc comments form
Date:
Subject: Error when following a documentation