pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Phil Sorber <phil@omniti.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Prepared Statement Name Truncation
Date: Sat, 17 Nov 2012 21:46:46 -0500
Message-ID: <20121118024646.GH5162@tamriel.snowman.net> (raw)
In-Reply-To: <CADAkt-hGbxM6QXrPDR=f+VV1PEABLf+i8eu71VSR_vBg5r=P=Q@mail.gmail.com>
References: <CADAkt-hGbxM6QXrPDR=f+VV1PEABLf+i8eu71VSR_vBg5r=P=Q@mail.gmail.com>

* Phil Sorber (phil@omniti.com) wrote:
> In addition it actually works!

Only until the ORM tries to create two tables that are identical except
for the last few characters..

> So I am sharing this with the list to see what people think. Is this a
> configuration bug? An ORM bug? A postgres bug? An unfortunate
> interaction?

It's a bug that the ORM doesn't correctly handle this particular
per-system limitation cleanly.

> If it's a postgres bug, what is the fix? Make the identifier max size
> longer? Set a hard limit and ERROR instead of truncating and NOTICE?
> Both? Neither because that would break backward compatibility?

Making the identifier longer wouldn't fix anything- an ORM might still
think it can make identifiers longer than whatever PG is configured to
support.  Making it unlimited in length would be a huge amount of work
without much gain, imv.  ERROR'ing instead of NOTICE'ing is certainly an
option, but it'd break any existing users of this busted ORM or other
similar setups.  That's not to say we couldn't do it, but it'd have to
be clearly stated in the release notes and be done as part of the next
major version of PG.

For my part, being very adverse to PG possibly giving the wrong result
(consider INSERT statements which work against a table that doesn't
exist- because the identifier is truncated and happens to end up
matching a table that does exist), I'd advocate changing this to be an
ERROR in 9.3.  I don't see the value in the truncation and feel it's
actually dangerous, particularly if ORMs are doing things like this.

	Thanks,

		Stephen

Attachments:

  signature.asc (application/pgp-signature, 197B) download

view thread (23+ messages)  latest in thread

Message-ID: <20121118024646.GH5162@tamriel.snowman.net>
Permalink:  ../20121118024646.GH5162@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20121118024646.GH5162@tamriel.snowman.net

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: sfrost@snowman.net, phil@omniti.com
  Subject: Re: Prepared Statement Name Truncation
  In-Reply-To: <20121118024646.GH5162@tamriel.snowman.net>
  References: <CADAkt-hGbxM6QXrPDR=f+VV1PEABLf+i8eu71VSR_vBg5r=P=Q@mail.gmail.com> <20121118024646.GH5162@tamriel.snowman.net>

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

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