Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e78b007

Browse files
committed
Change some notices to warnings and vice versa according to criteria
developed on -hackers.
1 parent 5b806ec commit e78b007

File tree

8 files changed

+31
-33
lines changed

8 files changed

+31
-33
lines changed

src/backend/commands/functioncmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.37 2003/09/29 00:05:24 petere Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/commands/functioncmds.c,v 1.38 2003/10/02 06:34:03 petere Exp $
1313
*
1414
* DESCRIPTION
1515
* These routines take the parse tree and pick out the
@@ -718,7 +718,7 @@ RenameFunction(List *name, List *argtypes, const char *newname)
718718
*
719719
* This is presently only used for adjusting legacy functions that return
720720
* OPAQUE to return whatever we find their correct definition should be.
721-
* The caller should emit a suitable NOTICE explaining what we did.
721+
* The caller should emit a suitable warning explaining what we did.
722722
*/
723723
void
724724
SetFunctionReturnType(Oid funcOid, Oid newRetType)

src/backend/commands/indexcmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.113 2003/09/29 16:37:29 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.114 2003/10/02 06:34:03 petere Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -654,7 +654,7 @@ ReindexTable(RangeVar *relation, bool force /* currently unused */ )
654654
ReleaseSysCache(tuple);
655655

656656
if (!reindex_relation(heapOid))
657-
ereport(WARNING,
657+
ereport(NOTICE,
658658
(errmsg("table \"%s\" has no indexes",
659659
relation->relname)));
660660
}

src/backend/commands/proclang.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.50 2003/09/25 06:57:58 petere Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/proclang.c,v 1.51 2003/10/02 06:34:03 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -91,7 +91,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
9191
*/
9292
if (funcrettype == OPAQUEOID)
9393
{
94-
ereport(NOTICE,
94+
ereport(WARNING,
9595
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
9696
errmsg("changing return type of function %s from \"opaque\" to \"language_handler\"",
9797
NameListToString(stmt->plhandler))));

src/backend/commands/trigger.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.158 2003/09/25 18:58:35 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/commands/trigger.c,v 1.159 2003/10/02 06:34:03 petere Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -286,7 +286,7 @@ CreateTrigger(CreateTrigStmt *stmt, bool forConstraint)
286286
*/
287287
if (funcrettype == OPAQUEOID)
288288
{
289-
ereport(NOTICE,
289+
ereport(WARNING,
290290
(errmsg("changing return type of function %s from \"opaque\" to \"trigger\"",
291291
NameListToString(stmt->funcname))));
292292
SetFunctionReturnType(funcoid, TRIGGEROID);

src/backend/commands/typecmds.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.47 2003/09/29 00:05:25 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/typecmds.c,v 1.48 2003/10/02 06:34:03 petere Exp $
1212
*
1313
* DESCRIPTION
1414
* The "DefineFoo" routines take the parse tree and pick out the
@@ -271,7 +271,7 @@ DefineType(List *names, List *parameters)
271271
if (resulttype == OPAQUEOID)
272272
{
273273
/* backwards-compatibility hack */
274-
ereport(NOTICE,
274+
ereport(WARNING,
275275
(errmsg("changing return type of function %s from \"opaque\" to %s",
276276
NameListToString(inputName), typeName)));
277277
SetFunctionReturnType(inputOid, typoid);
@@ -288,7 +288,7 @@ DefineType(List *names, List *parameters)
288288
if (resulttype == OPAQUEOID)
289289
{
290290
/* backwards-compatibility hack */
291-
ereport(NOTICE,
291+
ereport(WARNING,
292292
(errmsg("changing return type of function %s from \"opaque\" to \"cstring\"",
293293
NameListToString(outputName))));
294294
SetFunctionReturnType(outputOid, CSTRINGOID);
@@ -839,7 +839,7 @@ findTypeInputFunction(List *procname, Oid typeOid)
839839
* three arguments (string, element OID, typmod).
840840
*
841841
* For backwards compatibility we allow OPAQUE in place of CSTRING; if we
842-
* see this, we issue a NOTICE and fix up the pg_proc entry.
842+
* see this, we issue a warning and fix up the pg_proc entry.
843843
*/
844844
MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
845845

@@ -874,7 +874,7 @@ findTypeInputFunction(List *procname, Oid typeOid)
874874
if (OidIsValid(procOid))
875875
{
876876
/* Found, but must complain and fix the pg_proc entry */
877-
ereport(NOTICE,
877+
ereport(WARNING,
878878
(errmsg("changing argument type of function %s from \"opaque\" to \"cstring\"",
879879
NameListToString(procname))));
880880
SetFunctionArgType(procOid, 0, CSTRINGOID);
@@ -910,7 +910,7 @@ findTypeOutputFunction(List *procname, Oid typeOid)
910910
* arguments (data value, element OID).
911911
*
912912
* For backwards compatibility we allow OPAQUE in place of the actual
913-
* type name; if we see this, we issue a NOTICE and fix up the pg_proc
913+
* type name; if we see this, we issue a warning and fix up the pg_proc
914914
* entry.
915915
*/
916916
MemSet(argList, 0, FUNC_MAX_ARGS * sizeof(Oid));
@@ -944,7 +944,7 @@ findTypeOutputFunction(List *procname, Oid typeOid)
944944
if (OidIsValid(procOid))
945945
{
946946
/* Found, but must complain and fix the pg_proc entry */
947-
ereport(NOTICE,
947+
ereport(WARNING,
948948
(errmsg("changing argument type of function %s from \"opaque\" to %s",
949949
NameListToString(procname), format_type_be(typeOid))));
950950
SetFunctionArgType(procOid, 0, typeOid);

src/backend/parser/gram.y

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.435 2003/09/26 15:27:32 petere Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.436 2003/10/02 06:34:04 petere Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -973,7 +973,7 @@ zone_value:
973973
$3)));
974974
if ($3 > MAX_INTERVAL_PRECISION)
975975
{
976-
ereport(NOTICE,
976+
ereport(WARNING,
977977
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
978978
errmsg("INTERVAL(%d) precision reduced to maximum allowed, %d",
979979
$3, MAX_INTERVAL_PRECISION)));
@@ -5091,7 +5091,7 @@ SimpleTypename:
50915091
$3)));
50925092
if ($3 > MAX_INTERVAL_PRECISION)
50935093
{
5094-
ereport(NOTICE,
5094+
ereport(WARNING,
50955095
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
50965096
errmsg("INTERVAL(%d) precision reduced to maximum allowed, %d",
50975097
$3, MAX_INTERVAL_PRECISION)));
@@ -5470,7 +5470,7 @@ ConstDatetime:
54705470
$3, ($5 ? " WITH TIME ZONE": ""))));
54715471
if ($3 > MAX_TIMESTAMP_PRECISION)
54725472
{
5473-
ereport(NOTICE,
5473+
ereport(WARNING,
54745474
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
54755475
errmsg("TIMESTAMP(%d)%s precision reduced to maximum allowed, %d",
54765476
$3, ($5 ? " WITH TIME ZONE": ""),
@@ -5511,7 +5511,7 @@ ConstDatetime:
55115511
$3, ($5 ? " WITH TIME ZONE": ""))));
55125512
if ($3 > MAX_TIME_PRECISION)
55135513
{
5514-
ereport(NOTICE,
5514+
ereport(WARNING,
55155515
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
55165516
errmsg("TIME(%d)%s precision reduced to maximum allowed, %d",
55175517
$3, ($5 ? " WITH TIME ZONE": ""),
@@ -6318,7 +6318,7 @@ c_expr: columnref { $$ = (Node *) $1; }
63186318
$3)));
63196319
if ($3 > MAX_TIME_PRECISION)
63206320
{
6321-
ereport(NOTICE,
6321+
ereport(WARNING,
63226322
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
63236323
errmsg("CURRENT_TIME(%d) precision reduced to maximum allowed, %d",
63246324
$3, MAX_TIME_PRECISION)));
@@ -6372,7 +6372,7 @@ c_expr: columnref { $$ = (Node *) $1; }
63726372
$3)));
63736373
if ($3 > MAX_TIMESTAMP_PRECISION)
63746374
{
6375-
ereport(NOTICE,
6375+
ereport(WARNING,
63766376
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
63776377
errmsg("CURRENT_TIMESTAMP(%d) precision reduced to maximum allowed, %d",
63786378
$3, MAX_TIMESTAMP_PRECISION)));
@@ -6425,7 +6425,7 @@ c_expr: columnref { $$ = (Node *) $1; }
64256425
$3)));
64266426
if ($3 > MAX_TIME_PRECISION)
64276427
{
6428-
ereport(NOTICE,
6428+
ereport(WARNING,
64296429
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
64306430
errmsg("LOCALTIME(%d) precision reduced to maximum allowed, %d",
64316431
$3, MAX_TIME_PRECISION)));
@@ -6479,7 +6479,7 @@ c_expr: columnref { $$ = (Node *) $1; }
64796479
$3)));
64806480
if ($3 > MAX_TIMESTAMP_PRECISION)
64816481
{
6482-
ereport(NOTICE,
6482+
ereport(WARNING,
64836483
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
64846484
errmsg("LOCALTIMESTAMP(%d) precision reduced to maximum allowed, %d",
64856485
$3, MAX_TIMESTAMP_PRECISION)));
@@ -7189,7 +7189,7 @@ AexprConst: Iconst
71897189
$3)));
71907190
if ($3 > MAX_INTERVAL_PRECISION)
71917191
{
7192-
ereport(NOTICE,
7192+
ereport(WARNING,
71937193
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
71947194
errmsg("INTERVAL(%d) precision reduced to maximum allowed, %d",
71957195
$3, MAX_INTERVAL_PRECISION)));

src/backend/tcop/postgres.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.368 2003/09/29 18:50:58 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.369 2003/10/02 06:34:04 petere Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -559,8 +559,7 @@ pg_rewrite_queries(List *querytree_list)
559559
new_list = (List *) copyObject(querytree_list);
560560
/* This checks both copyObject() and the equal() routines... */
561561
if (!equal(new_list, querytree_list))
562-
ereport(WARNING,
563-
(errmsg("copyObject() failed to produce an equal parse tree")));
562+
elog(WARNING, "copyObject() failed to produce an equal parse tree");
564563
else
565564
querytree_list = new_list;
566565
#endif
@@ -604,8 +603,7 @@ pg_plan_query(Query *querytree)
604603
#ifdef NOT_USED
605604
/* This checks both copyObject() and the equal() routines... */
606605
if (!equal(new_plan, plan))
607-
ereport(WARNING,
608-
(errmsg("copyObject() failed to produce an equal plan tree")));
606+
elog(WARNING, "copyObject() failed to produce an equal plan tree");
609607
else
610608
#endif
611609
plan = new_plan;
@@ -2654,7 +2652,7 @@ PostgresMain(int argc, char *argv[], const char *username)
26542652
if (!IsUnderPostmaster)
26552653
{
26562654
puts("\nPOSTGRES backend interactive interface ");
2657-
puts("$Revision: 1.368 $ $Date: 2003/09/29 18:50:58 $\n");
2655+
puts("$Revision: 1.369 $ $Date: 2003/10/02 06:34:04 $\n");
26582656
}
26592657

26602658
/*

src/backend/tcop/utility.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.207 2003/09/24 18:54:01 tgl Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.208 2003/10/02 06:34:04 petere Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -1555,7 +1555,7 @@ CreateCommandTag(Node *parsetree)
15551555
break;
15561556

15571557
default:
1558-
elog(NOTICE, "unrecognized node type: %d",
1558+
elog(WARNING, "unrecognized node type: %d",
15591559
(int) nodeTag(parsetree));
15601560
tag = "???";
15611561
break;

0 commit comments

Comments
 (0)