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

Commit519ad24

Browse files
committed
Here's a small patch to cause pg_dump to emit the
scale and precision for NUMERIC type column defs.Keith Parks
1 parent0b885e2 commit519ad24

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

‎src/bin/pg_dump/pg_dump.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
*
2323
* IDENTIFICATION
24-
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.105 1999/05/10 00:46:18 momjian Exp $
24+
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.106 1999/05/13 02:35:44 momjian Exp $
2525
*
2626
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
2727
*
@@ -2671,6 +2671,10 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
26712671
char**parentRels;/* list of names of parent relations */
26722672
intnumParents;
26732673
intactual_atts;/* number of attrs in this CREATE statment */
2674+
int32tmp_typmod;
2675+
intprecision;
2676+
intscale;
2677+
26742678

26752679
/* First - dump SEQUENCEs */
26762680
if (tablename)
@@ -2749,6 +2753,18 @@ dumpTables(FILE *fout, TableInfo *tblinfo, int numTables,
27492753
tblinfo[i].atttypmod[j]-VARHDRSZ);
27502754
}
27512755
}
2756+
elseif (!strcmp(tblinfo[i].typnames[j],"numeric"))
2757+
{
2758+
sprintf(q+strlen(q),"numeric");
2759+
if (tblinfo[i].atttypmod[j]!=-1)
2760+
{
2761+
tmp_typmod=tblinfo[i].atttypmod[j]-VARHDRSZ;
2762+
precision= (tmp_typmod >>16)&0xffff;
2763+
scale=tmp_typmod&0xffff;
2764+
sprintf(q+strlen(q),"(%d,%d)",
2765+
precision,scale);
2766+
}
2767+
}
27522768
/* char is an internal single-byte data type;
27532769
* Let's make sure we force it through with quotes.
27542770
* - thomas 1998-12-13

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp