aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ri_triggers.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-05-12 15:17:30 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-05-12 15:17:30 -0400
commit23e7b38bfe396f919fdb66057174d29e17086418 (patch)
tree335c3962ef8afe0f6193d0413dbc51642276b147 /src/backend/utils/adt/ri_triggers.c
parent93909599cdba64c8759d646983c0a4ef93de1e50 (diff)
downloadpostgresql-23e7b38bfe396f919fdb66057174d29e17086418.tar.gz
postgresql-23e7b38bfe396f919fdb66057174d29e17086418.zip
Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files. I manually fixed a couple of comments that pgindent uglified.
Diffstat (limited to 'src/backend/utils/adt/ri_triggers.c')
-rw-r--r--src/backend/utils/adt/ri_triggers.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/backend/utils/adt/ri_triggers.c b/src/backend/utils/adt/ri_triggers.c
index 01d4c22cfce..51b3fdc9a01 100644
--- a/src/backend/utils/adt/ri_triggers.c
+++ b/src/backend/utils/adt/ri_triggers.c
@@ -113,8 +113,10 @@ typedef struct RI_ConstraintInfo
Oid fk_relid; /* referencing relation */
char confupdtype; /* foreign key's ON UPDATE action */
char confdeltype; /* foreign key's ON DELETE action */
- int ndelsetcols; /* number of columns referenced in ON DELETE SET clause */
- int16 confdelsetcols[RI_MAX_NUMKEYS]; /* attnums of cols to set on delete */
+ int ndelsetcols; /* number of columns referenced in ON DELETE
+ * SET clause */
+ int16 confdelsetcols[RI_MAX_NUMKEYS]; /* attnums of cols to set on
+ * delete */
char confmatchtype; /* foreign key's match type */
int nkeys; /* number of key columns */
int16 pk_attnums[RI_MAX_NUMKEYS]; /* attnums of referenced cols */
@@ -1059,7 +1061,8 @@ ri_set(TriggerData *trigdata, bool is_set_null, int tgkind)
/*
* Fetch or prepare a saved plan for the trigger.
*/
- switch (tgkind) {
+ switch (tgkind)
+ {
case RI_TRIGTYPE_UPDATE:
queryno = is_set_null
? RI_PLAN_SETNULL_ONUPDATE
@@ -1086,25 +1089,29 @@ ri_set(TriggerData *trigdata, bool is_set_null, int tgkind)
const char *qualsep;
Oid queryoids[RI_MAX_NUMKEYS];
const char *fk_only;
- int num_cols_to_set;
+ int num_cols_to_set;
const int16 *set_cols;
- switch (tgkind) {
+ switch (tgkind)
+ {
case RI_TRIGTYPE_UPDATE:
num_cols_to_set = riinfo->nkeys;
set_cols = riinfo->fk_attnums;
break;
case RI_TRIGTYPE_DELETE:
+
/*
- * If confdelsetcols are present, then we only update
- * the columns specified in that array, otherwise we
- * update all the referencing columns.
+ * If confdelsetcols are present, then we only update the
+ * columns specified in that array, otherwise we update all
+ * the referencing columns.
*/
- if (riinfo->ndelsetcols != 0) {
+ if (riinfo->ndelsetcols != 0)
+ {
num_cols_to_set = riinfo->ndelsetcols;
set_cols = riinfo->confdelsetcols;
}
- else {
+ else
+ {
num_cols_to_set = riinfo->nkeys;
set_cols = riinfo->fk_attnums;
}