Re: generated constraint name
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Peter Eisentraut <peter@eisentraut.org>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>,
"y.saburov@gmail.com" <y.saburov@gmail.com>,
"pgsql-docs@lists.postgresql.org" <pgsql-docs@lists.postgresql.org>
Date: 2025-04-10T15:13:00Z
Lists: pgsql-docs
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
Commits
-
doc: Small example improvement
- 913c60b067aa 18.0 landed
-
Doc: remove long-obsolete advice about generated constraint names.
- deb99dcba7e3 13.21 landed
- 95e83859b94e 14.18 landed
- fc44ae215fcb 15.13 landed
- 047495f1a80d 16.9 landed
- 03faf38a13e5 17.5 landed
- d89335eea67c 18.0 landed