Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita83bd89

Browse files
committed
Indent new rename.c for Tom Lane.
1 parentb52950c commita83bd89

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

‎src/backend/commands/rename.c

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.62 2001/11/1200:46:36 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/rename.c,v 1.63 2001/11/1201:34:50 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -41,16 +41,16 @@
4141
#include"utils/temprel.h"
4242

4343

44-
#defineRI_TRIGGER_PK1/* is a trigger on the PK relation */
45-
#defineRI_TRIGGER_FK2/* is a trigger on the FK relation */
44+
#defineRI_TRIGGER_PK1/* is a trigger on the PK relation */
45+
#defineRI_TRIGGER_FK2/* is a trigger on the FK relation */
4646
#defineRI_TRIGGER_NONE 0/* is not an RI trigger function */
4747

48-
staticintri_trigger_type(Oidtgfoid);
48+
staticintri_trigger_type(Oidtgfoid);
4949
staticvoidupdate_ri_trigger_args(Oidrelid,
50-
constchar*oldname,
51-
constchar*newname,
52-
boolfk_scan,
53-
boolupdate_relname);
50+
constchar*oldname,
51+
constchar*newname,
52+
boolfk_scan,
53+
boolupdate_relname);
5454

5555

5656
/*
@@ -251,7 +251,7 @@ renameatt(char *relname,
251251
if (targetrelation->rd_rel->reltriggers>0)
252252
{
253253
/* update tgargs column reference where att is primary key */
254-
update_ri_trigger_args(RelationGetRelid(targetrelation),
254+
update_ri_trigger_args(RelationGetRelid(targetrelation),
255255
oldattname,newattname,
256256
false, false);
257257
/* update tgargs column reference where att is foreign key */
@@ -425,49 +425,49 @@ ri_trigger_type(Oid tgfoid)
425425
*/
426426
staticvoid
427427
update_ri_trigger_args(Oidrelid,
428-
constchar*oldname,
429-
constchar*newname,
430-
boolfk_scan,
431-
boolupdate_relname)
428+
constchar*oldname,
429+
constchar*newname,
430+
boolfk_scan,
431+
boolupdate_relname)
432432
{
433-
Relationtgrel;
434-
Relationirel;
435-
ScanKeyDataskey[1];
436-
IndexScanDescidxtgscan;
433+
Relationtgrel;
434+
Relationirel;
435+
ScanKeyDataskey[1];
436+
IndexScanDescidxtgscan;
437437
RetrieveIndexResultidxres;
438-
Datumvalues[Natts_pg_trigger];
439-
charnulls[Natts_pg_trigger];
440-
charreplaces[Natts_pg_trigger];
438+
Datumvalues[Natts_pg_trigger];
439+
charnulls[Natts_pg_trigger];
440+
charreplaces[Natts_pg_trigger];
441441

442442
tgrel=heap_openr(TriggerRelationName,RowExclusiveLock);
443443
if (fk_scan)
444444
irel=index_openr(TriggerConstrRelidIndex);
445445
else
446446
irel=index_openr(TriggerRelidIndex);
447447

448-
ScanKeyEntryInitialize(&skey[0],0x0,
448+
ScanKeyEntryInitialize(&skey[0],0x0,
449449
1,/* always column 1 of index */
450450
F_OIDEQ,
451451
ObjectIdGetDatum(relid));
452452
idxtgscan=index_beginscan(irel, false,1,skey);
453-
453+
454454
while ((idxres=index_getnext(idxtgscan,ForwardScanDirection))!=NULL)
455455
{
456-
HeapTupleDatatupledata;
457-
Bufferbuffer;
458-
HeapTupletuple;
459-
Form_pg_triggerpg_trigger;
460-
bytea*val;
461-
bytea*newtgargs;
462-
boolisnull;
463-
inttg_type;
464-
boolexamine_pk;
465-
boolchanged;
466-
inttgnargs;
467-
inti;
468-
intnewlen;
469-
constchar*arga[RI_MAX_ARGUMENTS];
470-
constchar*argp;
456+
HeapTupleDatatupledata;
457+
Bufferbuffer;
458+
HeapTupletuple;
459+
Form_pg_triggerpg_trigger;
460+
bytea*val;
461+
bytea*newtgargs;
462+
boolisnull;
463+
inttg_type;
464+
boolexamine_pk;
465+
boolchanged;
466+
inttgnargs;
467+
inti;
468+
intnewlen;
469+
constchar*arga[RI_MAX_ARGUMENTS];
470+
constchar*argp;
471471

472472
tupledata.t_self=idxres->heap_iptr;
473473
heap_fetch(tgrel,SnapshotNow,&tupledata,&buffer,idxtgscan);
@@ -487,8 +487,8 @@ update_ri_trigger_args(Oid relid,
487487
/*
488488
* It is an RI trigger, so parse the tgargs bytea.
489489
*
490-
* NB: we assume the field will never be compressed or moved
491-
*out ofline; so does trigger.c ...
490+
* NB: we assume the field will never be compressed or moved out of
491+
* line; so does trigger.c ...
492492
*/
493493
tgnargs=pg_trigger->tgnargs;
494494
val= (bytea*)fastgetattr(tuple,
@@ -505,15 +505,15 @@ update_ri_trigger_args(Oid relid,
505505
for (i=0;i<tgnargs;i++)
506506
{
507507
arga[i]=argp;
508-
argp+=strlen(argp)+1;
508+
argp+=strlen(argp)+1;
509509
}
510510

511511
/*
512512
* Figure out which item(s) to look at. If the trigger is
513-
* primary-key type and attached to my rel, I should look at
514-
*thePK fields; if it is foreign-key type and attached to my
515-
*rel, Ishould look at the FK fields. But the opposite rule
516-
*holds whenexamining triggers found by tgconstrrel search.
513+
* primary-key type and attached to my rel, I should look at the
514+
* PK fields; if it is foreign-key type and attached to my rel, I
515+
* should look at the FK fields. But the opposite rule holds when
516+
* examining triggers found by tgconstrrel search.
517517
*/
518518
examine_pk= (tg_type==RI_TRIGGER_PK)== (!fk_scan);
519519

@@ -590,27 +590,27 @@ update_ri_trigger_args(Oid relid,
590590
simple_heap_update(tgrel,&tuple->t_self,tuple);
591591

592592
{
593-
Relationirelations[Num_pg_attr_indices];
593+
Relationirelations[Num_pg_attr_indices];
594+
595+
CatalogOpenIndices(Num_pg_trigger_indices,Name_pg_trigger_indices,irelations);
596+
CatalogIndexInsert(irelations,Num_pg_trigger_indices,tgrel,tuple);
597+
CatalogCloseIndices(Num_pg_trigger_indices,irelations);
598+
}
594599

595-
CatalogOpenIndices(Num_pg_trigger_indices,Name_pg_trigger_indices,irelations);
596-
CatalogIndexInsert(irelations,Num_pg_trigger_indices,tgrel,tuple);
597-
CatalogCloseIndices(Num_pg_trigger_indices,irelations);
598-
}
599-
600600
/* free up our scratch memory */
601601
pfree(newtgargs);
602602
heap_freetuple(tuple);
603603
}
604604

605-
index_endscan(idxtgscan);
606-
index_close(irel);
605+
index_endscan(idxtgscan);
606+
index_close(irel);
607607

608608
heap_close(tgrel,RowExclusiveLock);
609609

610610
/*
611-
* Increment cmd counter to make updates visible; this is needed
612-
*incase the same tuple has to be updated again by next pass
613-
*(canhappen in case of a self-referential FK relationship).
611+
* Increment cmd counter to make updates visible; this is needed in
612+
* case the same tuple has to be updated again by next pass (can
613+
* happen in case of a self-referential FK relationship).
614614
*/
615-
CommandCounterIncrement();
615+
CommandCounterIncrement();
616616
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp