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

Commit92e8282

Browse files
committed
Add missing output routine for FkConstraint nodes.
1 parent1f42f1d commit92e8282

File tree

1 file changed

+27
-5
lines changed

1 file changed

+27
-5
lines changed

‎src/backend/nodes/outfuncs.c

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
66
* Portions Copyright (c) 1994, Regents of the University of California
77
*
8-
*$Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.146 2001/10/2505:49:31 momjian Exp $
8+
*$Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.147 2001/10/2514:08:11 tgl Exp $
99
*
1010
* NOTES
1111
* Every (plan) node in POSTGRES has an associated "out" routine which
@@ -1325,14 +1325,14 @@ _outAConst(StringInfo str, A_Const *node)
13251325
staticvoid
13261326
_outConstraint(StringInfostr,Constraint*node)
13271327
{
1328-
appendStringInfo(str," ");
1328+
appendStringInfo(str,"CONSTRAINT :name");
13291329
_outToken(str,node->name);
13301330
appendStringInfo(str," :type ");
13311331

13321332
switch (node->contype)
13331333
{
13341334
caseCONSTR_PRIMARY:
1335-
appendStringInfo(str,"PRIMARY KEY ");
1335+
appendStringInfo(str,"PRIMARY_KEY :keys ");
13361336
_outNode(str,node->keys);
13371337
break;
13381338

@@ -1351,11 +1351,11 @@ _outConstraint(StringInfo str, Constraint *node)
13511351
break;
13521352

13531353
caseCONSTR_NOTNULL:
1354-
appendStringInfo(str,"NOT NULL");
1354+
appendStringInfo(str,"NOT_NULL");
13551355
break;
13561356

13571357
caseCONSTR_UNIQUE:
1358-
appendStringInfo(str,"UNIQUE ");
1358+
appendStringInfo(str,"UNIQUE:keys");
13591359
_outNode(str,node->keys);
13601360
break;
13611361

@@ -1365,6 +1365,25 @@ _outConstraint(StringInfo str, Constraint *node)
13651365
}
13661366
}
13671367

1368+
staticvoid
1369+
_outFkConstraint(StringInfostr,FkConstraint*node)
1370+
{
1371+
appendStringInfo(str," FKCONSTRAINT :constr_name ");
1372+
_outToken(str,node->constr_name);
1373+
appendStringInfo(str," :pktable_name ");
1374+
_outToken(str,node->pktable_name);
1375+
appendStringInfo(str," :fk_attrs ");
1376+
_outNode(str,node->fk_attrs);
1377+
appendStringInfo(str," :pk_attrs ");
1378+
_outNode(str,node->pk_attrs);
1379+
appendStringInfo(str," :match_type ");
1380+
_outToken(str,node->match_type);
1381+
appendStringInfo(str," :actions %d :deferrable %s :initdeferred %s",
1382+
node->actions,
1383+
booltostr(node->deferrable),
1384+
booltostr(node->initdeferred));
1385+
}
1386+
13681387
staticvoid
13691388
_outCaseExpr(StringInfostr,CaseExpr*node)
13701389
{
@@ -1646,6 +1665,9 @@ _outNode(StringInfo str, void *obj)
16461665
caseT_Constraint:
16471666
_outConstraint(str,obj);
16481667
break;
1668+
caseT_FkConstraint:
1669+
_outFkConstraint(str,obj);
1670+
break;
16491671
caseT_CaseExpr:
16501672
_outCaseExpr(str,obj);
16511673
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp