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

Commit38633cf

Browse files
committed
Make the world safe for atttypmod=0 ... this didn't use to mean anything,
but timestamp now wants it to mean something.
1 parentdd154dd commit38633cf

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

‎src/backend/parser/parse_coerce.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.62 2001/10/03 05:29:12 thomas Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.63 2001/10/04 17:52:24 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -284,10 +284,9 @@ coerce_type_typmod(ParseState *pstate, Node *node,
284284
Oidoid_array[FUNC_MAX_ARGS];
285285

286286
/*
287-
* We assume that only typmod values greater than 0 indicate a forced
288-
* conversion is necessary.
287+
* A negative typmod is assumed to mean that no coercion is wanted.
289288
*/
290-
if ((atttypmod <=0)||(atttypmod==exprTypmod(node)))
289+
if (atttypmod<0||atttypmod==exprTypmod(node))
291290
returnnode;
292291

293292
funcname=typeidTypeName(targetTypeId);

‎src/backend/utils/adt/format_type.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.17 2001/10/03 18:32:42 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/format_type.c,v 1.18 2001/10/04 17:52:24 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -201,31 +201,31 @@ format_type_internal(Oid type_oid, int32 typemod, bool allow_invalid)
201201
break;
202202

203203
caseTIMEOID:
204-
if (with_typemod&&typemod>0)
204+
if (with_typemod)
205205
buf=psnprintf(50,"time(%d) without time zone",
206206
typemod);
207207
else
208208
buf=pstrdup("time without time zone");
209209
break;
210210

211211
caseTIMETZOID:
212-
if (with_typemod&&typemod>0)
212+
if (with_typemod)
213213
buf=psnprintf(50,"time(%d) with time zone",
214214
typemod);
215215
else
216216
buf=pstrdup("time with time zone");
217217
break;
218218

219219
caseTIMESTAMPOID:
220-
if (with_typemod&&typemod>0)
220+
if (with_typemod)
221221
buf=psnprintf(50,"timestamp(%d) without time zone",
222222
typemod);
223223
else
224224
buf=pstrdup("timestamp without time zone");
225225
break;
226226

227227
caseTIMESTAMPTZOID:
228-
if (with_typemod&&typemod>0)
228+
if (with_typemod)
229229
buf=psnprintf(50,"timestamp(%d) with time zone",
230230
typemod);
231231
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp