diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-17 01:15:55 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-03-17 01:15:55 +0000 |
commit | e88a7ad77486db0926d33b31962d274bc9fd08ae (patch) | |
tree | 536d21991b2f48f6be7ffdd300f265f84965e792 /src/backend/utils/adt/ruleutils.c | |
parent | 0f4ff460c479e9c9bff90e8208f0a5272b9925df (diff) | |
download | postgresql-e88a7ad77486db0926d33b31962d274bc9fd08ae.tar.gz postgresql-e88a7ad77486db0926d33b31962d274bc9fd08ae.zip |
Ooops, got only one of the two ArrayExpr variants correct in first
cut at exprTypmod support. Also, experimentation shows that we need
to label the type of Const nodes that are numeric with a specific
typmod.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index b1294b6d322..d97cfee3751 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.254 2007/03/17 00:11:05 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.255 2007/03/17 01:15:55 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -4427,8 +4427,11 @@ get_const_expr(Const *constval, deparse_context *context, bool showtype) needlabel = false; break; case NUMERICOID: - /* Float-looking constants will be typed as numeric */ - needlabel = !isfloat; + /* + * Float-looking constants will be typed as numeric, but if + * there's a specific typmod we need to show it. + */ + needlabel = !isfloat || (constval->consttypmod >= 0); break; default: needlabel = true; |