pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Think-o in foreign key comments
3+ messages / 3 participants
[nested] [flat]

Commits from this thread:
  2022-12-07 5e9b122059 6bcd1d9f30  Fix FK comment think-o
* Think-o in foreign key comments
@ 2022-12-02 22:18  Paul Jungwirth <pj@illuminatedcomputing.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Paul Jungwirth @ 2022-12-02 22:18 UTC (permalink / raw)
  To: pgsql-hackers

Hello,

I noticed a few places in the new foreign key code where a comment says 
"the ON DELETE SET NULL/DELETE clause". I believe it should say "ON 
DELETE SET NULL/DEFAULT".

These comments were added in d6f96ed94e7, "Allow specifying column list 
for foreign key ON DELETE SET actions." Here is a patch to correct them. 
I don't think you usually create a commitfest entry for tiny fixes like 
this, right? But if you'd like one please let me know and I'll add it.

Yours,

-- 
Paul              ~{:-)
pj@illuminatedcomputing.com

Attachments:

v1-0001-Fix-FK-comment-think-o.patch (text/x-patch, 2.1K) download From dc5e317762266b93bfa44bb303fe1882853d8de7 Mon Sep 17 00:00:00 2001 From: "Paul A. Jungwirth" <pj@illuminatedcomputing.com> Date: Fri, 2 Dec 2022 14:02:55 -0800 Subject: [PATCH v1] Fix FK comment think-o --- src/backend/commands/tablecmds.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 3e83f375b5..716793e157 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -9467,10 +9467,10 @@ validateFkOnDeleteSetColumns(int numfks, const int16 *fkattnums, * numfks is the number of columns in the foreign key * pkattnum is the attnum array of referenced attributes. * fkattnum is the attnum array of referencing attributes. - * numfkdelsetcols is the number of columns in the ON DELETE SET NULL/DELETE + * numfkdelsetcols is the number of columns in the ON DELETE SET NULL/DEFAULT * (...) clause * fkdelsetcols is the attnum array of the columns in the ON DELETE SET - * NULL/DELETE clause + * NULL/DEFAULT clause * pf/pp/ffeqoperators are OID array of operators between columns. * old_check_ok signals that this constraint replaces an existing one that * was already validated (thus this one doesn't need validation). @@ -9686,10 +9686,10 @@ addFkRecurseReferenced(List **wqueue, Constraint *fkconstraint, Relation rel, * pkattnum is the attnum array of referenced attributes. * fkattnum is the attnum array of referencing attributes. * pf/pp/ffeqoperators are OID array of operators between columns. - * numfkdelsetcols is the number of columns in the ON DELETE SET NULL/DELETE + * numfkdelsetcols is the number of columns in the ON DELETE SET NULL/DEFAULT * (...) clause * fkdelsetcols is the attnum array of the columns in the ON DELETE SET - * NULL/DELETE clause + * NULL/DEFAULT clause * old_check_ok signals that this constraint replaces an existing one that * was already validated (thus this one doesn't need validation). * lockmode is the lockmode to acquire on partitions when recursing. -- 2.25.1
^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: Think-o in foreign key comments
@ 2022-12-03 04:59  Ian Lawrence Barwick <barwick@gmail.com>
  parent: Paul Jungwirth <pj@illuminatedcomputing.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Ian Lawrence Barwick @ 2022-12-03 04:59 UTC (permalink / raw)
  To: Paul Jungwirth <pj@illuminatedcomputing.com>; +Cc: pgsql-hackers

2022年12月3日(土) 7:19 Paul Jungwirth <pj@illuminatedcomputing.com>:
>
> Hello,
>
> I noticed a few places in the new foreign key code where a comment says
> "the ON DELETE SET NULL/DELETE clause". I believe it should say "ON
> DELETE SET NULL/DEFAULT".
>
> These comments were added in d6f96ed94e7, "Allow specifying column list
> for foreign key ON DELETE SET actions." Here is a patch to correct them.

LGTM.

I do notice the same patch adds the function "validateFkOnDeleteSetColumns"
but the name in the comment preceding it is "validateFkActionSetColumns",
might as well fix that the same time.

> I don't think you usually create a commitfest entry for tiny fixes like
> this, right? But if you'd like one please let me know and I'll add it.

From experience usually a committer will pick up trivial fixes like this
within a few days, but if it escapes notice for more than a couple of weeks
a reminder and/or CF entry might be useful to make sure it doesn't get
forgotten.

Regards

Ian Barwick





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Think-o in foreign key comments
@ 2022-12-07 16:11  Peter Eisentraut <peter.eisentraut@enterprisedb.com>
  parent: Ian Lawrence Barwick <barwick@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Peter Eisentraut @ 2022-12-07 16:11 UTC (permalink / raw)
  To: Ian Lawrence Barwick <barwick@gmail.com>; Paul Jungwirth <pj@illuminatedcomputing.com>; +Cc: pgsql-hackers

On 03.12.22 05:59, Ian Lawrence Barwick wrote:
> 2022年12月3日(土) 7:19 Paul Jungwirth <pj@illuminatedcomputing.com>:
>> I noticed a few places in the new foreign key code where a comment says
>> "the ON DELETE SET NULL/DELETE clause". I believe it should say "ON
>> DELETE SET NULL/DEFAULT".
>>
>> These comments were added in d6f96ed94e7, "Allow specifying column list
>> for foreign key ON DELETE SET actions." Here is a patch to correct them.
> 
> LGTM.
> 
> I do notice the same patch adds the function "validateFkOnDeleteSetColumns"
> but the name in the comment preceding it is "validateFkActionSetColumns",
> might as well fix that the same time.

Committed with that addition and backpatched to PG15.






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2022-12-07 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 22:18 Think-o in foreign key comments Paul Jungwirth <pj@illuminatedcomputing.com>
2022-12-03 04:59 ` Ian Lawrence Barwick <barwick@gmail.com>
2022-12-07 16:11   ` Peter Eisentraut <peter.eisentraut@enterprisedb.com>

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