]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Don't print NO ACTION foreign key actions in dumps and psql \d.
authorBruce Momjian <bruce@momjian.us>
Mon, 3 Feb 2003 15:17:24 +0000 (15:17 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 3 Feb 2003 15:17:24 +0000 (15:17 +0000)
src/backend/utils/adt/ruleutils.c

index d7474b4d7f7d64b0575b499236e40a809b237dbd..df5890358b83d32dbdd6c262c3ef258658607940 100644 (file)
@@ -3,7 +3,7 @@
  *                             back to source text
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.132 2003/01/10 21:08:15 tgl Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.133 2003/02/03 15:17:24 momjian Exp $
  *
  *       This software is copyrighted by Jan Wieck - Hamburg.
  *
@@ -642,7 +642,7 @@ pg_get_constraintdef(PG_FUNCTION_ARGS)
                                switch (conForm->confupdtype)
                                {
                                        case FKCONSTR_ACTION_NOACTION:
-                                               string = "NO ACTION";
+                                               string = "";
                                                break;
                                        case FKCONSTR_ACTION_RESTRICT:
                                                string = "RESTRICT";
@@ -662,12 +662,13 @@ pg_get_constraintdef(PG_FUNCTION_ARGS)
                                                string = "";    /* keep compiler quiet */
                                                break;
                                }
-                               appendStringInfo(&buf, " ON UPDATE %s", string);
+                               if (strlen(string) != 0)
+                                       appendStringInfo(&buf, " ON UPDATE %s", string);
 
                                switch (conForm->confdeltype)
                                {
                                        case FKCONSTR_ACTION_NOACTION:
-                                               string = "NO ACTION";
+                                               string = "";
                                                break;
                                        case FKCONSTR_ACTION_RESTRICT:
                                                string = "RESTRICT";
@@ -687,7 +688,8 @@ pg_get_constraintdef(PG_FUNCTION_ARGS)
                                                string = "";    /* keep compiler quiet */
                                                break;
                                }
-                               appendStringInfo(&buf, " ON DELETE %s", string);
+                               if (strlen(string) != 0)
+                                       appendStringInfo(&buf, " ON DELETE %s", string);
 
                                if (conForm->condeferrable)
                                        appendStringInfo(&buf, " DEFERRABLE");