agora inbox for pgsql-docs@postgresql.org  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: y.saburov@gmail.com <y.saburov@gmail.com>
Cc: pgsql-docs@lists.postgresql.org <pgsql-docs@lists.postgresql.org>
Subject: Re: generated constraint name
Date: Thu, 10 Apr 2025 11:13:00 -0400
Message-ID: <520881.1744297980@sss.pgh.pa.us> (raw)
In-Reply-To: <8fd70ac1-9eb2-49bf-bdb4-dd2b12beb25e@eisentraut.org>
References: <174393459040.678.17810152410419444783@wrigleys.postgresql.org>
	<CAKFQuwZn3KTfC75+3u8W31CtJNnUcs5ZQQGUG=wcQW3FLSvx1Q@mail.gmail.com>
	<8fd70ac1-9eb2-49bf-bdb4-dd2b12beb25e@eisentraut.org>

Peter Eisentraut <peter@eisentraut.org> writes:
> On 07.04.25 15:34, David G. Johnston wrote:
>> I feel like that whole parenthetical should just go away.  The point of 
>> the comment is to remind the user of how identifier values work with 
>> respect to mandatory double quoting.  The name itself, other than having 
>> a $, has no special importance.

> I think generated constraint names were generally "$1", "$2", etc. at 
> some point, instead of the more readable ones you get today.  But this 
> must be ancient.

Good point.  A bit of git-blame'ing shows that this documentation
wording appeared in e560dd353 of 2003-11-05, but we changed the
generation rule to not be "$n" in 45616f5bb of 2004-06-10.
(Oddly, I moved this documentation text around in 2005 without
noticing it was obsolete; or perhaps I did realize that but figured
it was still applicable to versions in the field.)

I concur with David that we should just drop the para.  It's merely
confusing now.  If you have a generated constraint name, it won't
require double-quoting unless your table or column name does, and
if they do you are doubtless already quite familiar with how
quoting works.

			regards, tom lane





view thread (9+ messages)  latest in thread

Message-ID: <520881.1744297980@sss.pgh.pa.us>
Permalink:  ../520881.1744297980@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/520881.1744297980@sss.pgh.pa.us

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: pgsql-docs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, peter@eisentraut.org, david.g.johnston@gmail.com, y.saburov@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: generated constraint name
  In-Reply-To: <520881.1744297980@sss.pgh.pa.us>

* 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