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
16143d64
Commit
16143d64
authored
Mar 01, 2011
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dump the COLLATABLE attribute in CREATE TYPE
This was previously omitted by accident.
parent
09b49a84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
src/bin/pg_dump/pg_dump.c
src/bin/pg_dump/pg_dump.c
+34
-1
No files found.
src/bin/pg_dump/pg_dump.c
View file @
16143d64
...
...
@@ -7305,6 +7305,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
char
*
typbyval
;
char
*
typalign
;
char
*
typstorage
;
char
*
typcollatable
;
char
*
typdefault
;
bool
typdefault_is_literal
=
false
;
...
...
@@ -7312,7 +7313,27 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
selectSourceSchema
(
tyinfo
->
dobj
.
namespace
->
dobj
.
name
);
/* Fetch type-specific details */
if
(
fout
->
remoteVersion
>=
80400
)
if
(
fout
->
remoteVersion
>=
90100
)
{
appendPQExpBuffer
(
query
,
"SELECT typlen, "
"typinput, typoutput, typreceive, typsend, "
"typmodin, typmodout, typanalyze, "
"typinput::pg_catalog.oid AS typinputoid, "
"typoutput::pg_catalog.oid AS typoutputoid, "
"typreceive::pg_catalog.oid AS typreceiveoid, "
"typsend::pg_catalog.oid AS typsendoid, "
"typmodin::pg_catalog.oid AS typmodinoid, "
"typmodout::pg_catalog.oid AS typmodoutoid, "
"typanalyze::pg_catalog.oid AS typanalyzeoid, "
"typcategory, typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"(typcollation = (SELECT oid FROM pg_catalog.pg_collation WHERE collname = 'default')) AS typcollatable, "
"pg_catalog.pg_get_expr(typdefaultbin, 0) AS typdefaultbin, typdefault "
"FROM pg_catalog.pg_type "
"WHERE oid = '%u'::pg_catalog.oid"
,
tyinfo
->
dobj
.
catId
.
oid
);
}
else
if
(
fout
->
remoteVersion
>=
80400
)
{
appendPQExpBuffer
(
query
,
"SELECT typlen, "
"typinput, typoutput, typreceive, typsend, "
...
...
@@ -7326,6 +7347,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"typanalyze::pg_catalog.oid AS typanalyzeoid, "
"typcategory, typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"pg_catalog.pg_get_expr(typdefaultbin, 0) AS typdefaultbin, typdefault "
"FROM pg_catalog.pg_type "
"WHERE oid = '%u'::pg_catalog.oid"
,
...
...
@@ -7346,6 +7368,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"typanalyze::pg_catalog.oid AS typanalyzeoid, "
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
"FROM pg_catalog.pg_type "
"WHERE oid = '%u'::pg_catalog.oid"
,
...
...
@@ -7365,6 +7388,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"typanalyze::pg_catalog.oid AS typanalyzeoid, "
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
"FROM pg_catalog.pg_type "
"WHERE oid = '%u'::pg_catalog.oid"
,
...
...
@@ -7384,6 +7408,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"0 AS typanalyzeoid, "
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
"FROM pg_catalog.pg_type "
"WHERE oid = '%u'::pg_catalog.oid"
,
...
...
@@ -7403,6 +7428,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"0 AS typanalyzeoid, "
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"pg_catalog.pg_get_expr(typdefaultbin, 'pg_catalog.pg_type'::pg_catalog.regclass) AS typdefaultbin, typdefault "
"FROM pg_catalog.pg_type "
"WHERE oid = '%u'::pg_catalog.oid"
,
...
...
@@ -7426,6 +7452,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"0 AS typanalyzeoid, "
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"NULL AS typdefaultbin, typdefault "
"FROM pg_type "
"WHERE oid = '%u'::oid"
,
...
...
@@ -7449,6 +7476,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"0 AS typanalyzeoid, "
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, typstorage, "
"false AS typcollatable, "
"NULL AS typdefaultbin, NULL AS typdefault "
"FROM pg_type "
"WHERE oid = '%u'::oid"
,
...
...
@@ -7469,6 +7497,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
"'U' AS typcategory, false AS typispreferred, "
"typdelim, typbyval, typalign, "
"'p'::char AS typstorage, "
"false AS typcollatable, "
"NULL AS typdefaultbin, NULL AS typdefault "
"FROM pg_type "
"WHERE oid = '%u'::oid"
,
...
...
@@ -7510,6 +7539,7 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
typbyval
=
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"typbyval"
));
typalign
=
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"typalign"
));
typstorage
=
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"typstorage"
));
typcollatable
=
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"typcollatable"
));
if
(
!
PQgetisnull
(
res
,
0
,
PQfnumber
(
res
,
"typdefaultbin"
)))
typdefault
=
PQgetvalue
(
res
,
0
,
PQfnumber
(
res
,
"typdefaultbin"
));
else
if
(
!
PQgetisnull
(
res
,
0
,
PQfnumber
(
res
,
"typdefault"
)))
...
...
@@ -7566,6 +7596,9 @@ dumpBaseType(Archive *fout, TypeInfo *tyinfo)
/* receive/send/typmodin/typmodout/analyze need not be printed */
}
if
(
strcmp
(
typcollatable
,
"t"
)
==
0
)
appendPQExpBuffer
(
q
,
",
\n
COLLATABLE = true"
);
if
(
typdefault
!=
NULL
)
{
appendPQExpBuffer
(
q
,
",
\n
DEFAULT = "
);
...
...
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