Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
519ad246
Commit
519ad246
authored
25 years ago
by
Bruce Momjian
Browse files
Options
Downloads
Patches
Plain Diff
Here's a small patch to cause pg_dump to emit the
scale and precision for NUMERIC type column defs. Keith Parks
parent
0b885e23
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/pg_dump/pg_dump.c
+17
-1
17 additions, 1 deletion
src/bin/pg_dump/pg_dump.c
with
17 additions
and
1 deletion
src/bin/pg_dump/pg_dump.c
+
17
−
1
View file @
519ad246
...
...
@@ -21,7 +21,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.10
5
1999/05/1
0
0
0:46:18
momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.10
6
1999/05/1
3
0
2:35:44
momjian Exp $
*
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
*
...
...
@@ -2671,6 +2671,10 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
char
**
parentRels
;
/* list of names of parent relations */
int
numParents
;
int
actual_atts
;
/* number of attrs in this CREATE statment */
int32
tmp_typmod
;
int
precision
;
int
scale
;
/* First - dump SEQUENCEs */
if
(
tablename
)
...
...
@@ -2749,6 +2753,18 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
tblinfo
[
i
].
atttypmod
[
j
]
-
VARHDRSZ
);
}
}
else
if
(
!
strcmp
(
tblinfo
[
i
].
typnames
[
j
],
"numeric"
))
{
sprintf
(
q
+
strlen
(
q
),
"numeric"
);
if
(
tblinfo
[
i
].
atttypmod
[
j
]
!=
-
1
)
{
tmp_typmod
=
tblinfo
[
i
].
atttypmod
[
j
]
-
VARHDRSZ
;
precision
=
(
tmp_typmod
>>
16
)
&
0xffff
;
scale
=
tmp_typmod
&
0xffff
;
sprintf
(
q
+
strlen
(
q
),
"(%d,%d)"
,
precision
,
scale
);
}
}
/* char is an internal single-byte data type;
* Let's make sure we force it through with quotes.
* - thomas 1998-12-13
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment