Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
454913c1
Commit
454913c1
authored
Jun 20, 1998
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove -c option for Constraint syntax so we us it by default.
parent
5fdefbc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
37 deletions
+11
-37
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+11
-37
No files found.
src/bin/pg_dump/pg_dump.c
View file @
454913c1
...
...
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.7
5 1998/06/19 02:55:14
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.7
6 1998/06/20 02:49:38
momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -110,7 +110,6 @@ int dumpData; /* dump data using proper insert strings */
int
attrNames
;
/* put attr names into insert strings */
int
schemaOnly
;
int
dataOnly
;
int
compatConstraint
;
char
g_opaque_type
[
10
];
/* name for the opaque type */
...
...
@@ -126,8 +125,6 @@ usage(const char *progname)
"usage: %s [options] dbname
\n
"
,
progname
);
fprintf
(
stderr
,
"
\t
-a
\t\t
dump out only the data, no schema
\n
"
);
fprintf
(
stderr
,
"
\t
-c
\t\t
generate pgsql-compatible CONSTRAINT syntax
\n
"
);
fprintf
(
stderr
,
"
\t
-d
\t\t
dump data as proper insert strings
\n
"
);
fprintf
(
stderr
,
...
...
@@ -553,21 +550,17 @@ main(int argc, char **argv)
g_comment_end
[
0
]
=
'\0'
;
strcpy
(
g_opaque_type
,
"opaque"
);
compatConstraint
=
dataOnly
=
schemaOnly
=
dumpData
=
attrNames
=
0
;
dataOnly
=
schemaOnly
=
dumpData
=
attrNames
=
0
;
progname
=
*
argv
;
while
((
c
=
getopt
(
argc
,
argv
,
"a
c
dDf:h:op:st:vzu"
))
!=
EOF
)
while
((
c
=
getopt
(
argc
,
argv
,
"adDf:h:op:st:vzu"
))
!=
EOF
)
{
switch
(
c
)
{
case
'a'
:
/* Dump data only */
dataOnly
=
1
;
break
;
case
'c'
:
/* generate constraint syntax that
can be read back into postgreSQL */
compatConstraint
=
1
;
break
;
case
'd'
:
/* dump data as proper insert strings */
dumpData
=
1
;
break
;
...
...
@@ -1499,12 +1492,7 @@ getTables(int *numTables, FuncInfo *finfo, int numFuncs)
query
[
0
]
=
0
;
if
(
name
[
0
]
!=
'$'
)
sprintf
(
query
,
"CONSTRAINT %s "
,
name
);
if
(
compatConstraint
)
{
sprintf
(
query
,
"%sCHECK (%s)"
,
query
,
expr
);
}
else
{
sprintf
(
query
,
"%sCHECK %s"
,
query
,
expr
);
}
sprintf
(
query
,
"%sCHECK (%s)"
,
query
,
expr
);
tblinfo
[
i
].
check_expr
[
i2
]
=
strdup
(
query
);
}
PQclear
(
res2
);
...
...
@@ -2522,15 +2510,13 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
}
}
if
(
compatConstraint
)
{
/* put the CONSTRAINTS inside the table def */
for
(
k
=
0
;
k
<
tblinfo
[
i
].
ncheck
;
k
++
)
{
sprintf
(
q
,
"%s%s %s"
,
q
,
(
actual_atts
+
k
>
0
)
?
", "
:
""
,
tblinfo
[
i
].
check_expr
[
k
]);
}
/* put the CONSTRAINTS inside the table def */
for
(
k
=
0
;
k
<
tblinfo
[
i
].
ncheck
;
k
++
)
{
sprintf
(
q
,
"%s%s %s"
,
q
,
(
actual_atts
+
k
>
0
)
?
", "
:
""
,
tblinfo
[
i
].
check_expr
[
k
]);
}
strcat
(
q
,
")"
);
...
...
@@ -2548,18 +2534,6 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
strcat
(
q
,
")"
);
}
if
(
!
compatConstraint
)
{
/* put the CONSTRAINT defs outside the table def */
for
(
k
=
0
;
k
<
tblinfo
[
i
].
ncheck
;
k
++
)
{
sprintf
(
q
,
"%s%s %s"
,
q
,
(
k
>
0
)
?
", "
:
""
,
tblinfo
[
i
].
check_expr
[
k
]);
}
}
strcat
(
q
,
";
\n
"
);
fputs
(
q
,
fout
);
if
(
acls
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment