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

Commit cc26ea9

Browse files
committed
Clean up references to SQL92
In most cases, these were just references to the SQL standard in general. In a few cases, a contrast was made between SQL92 and later standards -- those have been kept unchanged.
1 parent 6e481eb commit cc26ea9

File tree

25 files changed

+65
-67
lines changed

25 files changed

+65
-67
lines changed

src/backend/catalog/pg_operator.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ validOperatorName(const char *name)
9292
return false;
9393

9494
/*
95-
* For SQL92 compatibility, '+' and '-' cannot be the last char of a
95+
* For SQL standard compatibility, '+' and '-' cannot be the last char of a
9696
* multi-char operator unless the operator contains chars that are not in
97-
* SQL92 operators. The idea is to lex '=-' as two operators, but not to
98-
* forbid operator names like '?-' that could not be sequences of SQL92
97+
* SQL operators. The idea is to lex '=-' as two operators, but not to
98+
* forbid operator names like '?-' that could not be sequences of standard SQL
9999
* operators.
100100
*/
101101
if (len > 1 &&

src/backend/executor/execMain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,7 @@ ExecRelCheck(ResultRelInfo *resultRelInfo,
16181618
qual = resultRelInfo->ri_ConstraintExprs[i];
16191619

16201620
/*
1621-
* NOTE: SQL92 specifies that a NULL result from a constraint
1621+
* NOTE: SQL specifies that a NULL result from a constraint
16221622
* expression is not to be treated as a failure. Therefore, tell
16231623
* ExecQual to return TRUE for NULL.
16241624
*/

src/backend/parser/gram.y

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
* NOTES
2222
* CAPITALS are used to represent terminal symbols.
2323
* non-capitals are used to represent non-terminals.
24-
* SQL92-specific syntax is separated from plain SQL/Postgres syntax
25-
* to help isolate the non-extensible portions of the parser.
2624
*
2725
* In general, nothing in this file should initiate database accesses
2826
* nor depend on changeable state (such as SET variables). If you do
@@ -1281,7 +1279,7 @@ schema_stmt:
12811279
*
12821280
* Set PG internal variable
12831281
* SET name TO 'var_value'
1284-
* Include SQL92 syntax (thomas 1997-10-22):
1282+
* Include SQL syntax (thomas 1997-10-22):
12851283
* SET TIME ZONE 'var_value'
12861284
*
12871285
*****************************************************************************/
@@ -2780,7 +2778,7 @@ ColConstraint:
27802778
* to make it explicit.
27812779
* - thomas 1998-09-13
27822780
*
2783-
* WITH NULL and NULL are not SQL92-standard syntax elements,
2781+
* WITH NULL and NULL are not SQL-standard syntax elements,
27842782
* so leave them out. Use DEFAULT NULL to explicitly indicate
27852783
* that a column may have that value. WITH NULL leads to
27862784
* shift/reduce conflicts with WITH TIME ZONE anyway.
@@ -9159,7 +9157,7 @@ select_clause:
91599157
* As with select_no_parens, simple_select cannot have outer parentheses,
91609158
* but can have parenthesized subclauses.
91619159
*
9162-
* Note that sort clauses cannot be included at this level --- SQL92 requires
9160+
* Note that sort clauses cannot be included at this level --- SQL requires
91639161
* SELECT foo UNION SELECT bar ORDER BY baz
91649162
* to be parsed as
91659163
* (SELECT foo UNION SELECT bar) ORDER BY baz
@@ -9660,7 +9658,7 @@ table_ref: relation_expr opt_alias_clause
96609658

96619659
/*
96629660
* It may seem silly to separate joined_table from table_ref, but there is
9663-
* method in SQL92's madness: if you don't do it this way you get reduce-
9661+
* method in SQL's madness: if you don't do it this way you get reduce-
96649662
* reduce conflicts, because it's not clear to the parser generator whether
96659663
* to expect alias_clause after ')' or not. For the same reason we must
96669664
* treat 'JOIN' and 'join_type JOIN' separately, rather than allowing
@@ -9959,7 +9957,7 @@ TableFuncElement: ColId Typename opt_collate_clause
99599957
/*****************************************************************************
99609958
*
99619959
* Type syntax
9962-
* SQL92 introduces a large amount of type-specific syntax.
9960+
* SQL introduces a large amount of type-specific syntax.
99639961
* Define individual clauses to handle these cases, and use
99649962
* the generic case to handle regular type-extensible Postgres syntax.
99659963
* - thomas 1997-10-10
@@ -10085,7 +10083,7 @@ opt_type_modifiers: '(' expr_list ')' { $$ = $2; }
1008510083
;
1008610084

1008710085
/*
10088-
* SQL92 numeric data types
10086+
* SQL numeric data types
1008910087
*/
1009010088
Numeric: INT_P
1009110089
{
@@ -10175,7 +10173,7 @@ opt_float: '(' Iconst ')'
1017510173
;
1017610174

1017710175
/*
10178-
* SQL92 bit-field data types
10176+
* SQL bit-field data types
1017910177
* The following implements BIT() and BIT VARYING().
1018010178
*/
1018110179
Bit: BitWithLength
@@ -10232,7 +10230,7 @@ BitWithoutLength:
1023210230

1023310231

1023410232
/*
10235-
* SQL92 character data types
10233+
* SQL character data types
1023610234
* The following implements CHAR() and VARCHAR().
1023710235
*/
1023810236
Character: CharacterWithLength
@@ -10329,7 +10327,7 @@ opt_charset:
1032910327
;
1033010328

1033110329
/*
10332-
* SQL92 date/time types
10330+
* SQL date/time types
1033310331
*/
1033410332
ConstDatetime:
1033510333
TIMESTAMP '(' Iconst ')' opt_timezone
@@ -10661,7 +10659,7 @@ a_expr: c_expr { $$ = $1; }
1066110659
}
1066210660

1066310661
/* NullTest clause
10664-
* Define SQL92-style Null test clause.
10662+
* Define SQL-style Null test clause.
1066510663
* Allow two forms described in the standard:
1066610664
* a IS NULL
1066710665
* a IS NOT NULL
@@ -11189,7 +11187,7 @@ func_expr: func_name '(' ')' over_clause
1118911187
/*
1119011188
* We consider AGGREGATE(*) to invoke a parameterless
1119111189
* aggregate. This does the right thing for COUNT(*),
11192-
* and there are no other aggregates in SQL92 that accept
11190+
* and there are no other aggregates in SQL that accept
1119311191
* '*' as parameter.
1119411192
*
1119511193
* The FuncCall node is also marked agg_star = true,
@@ -11505,7 +11503,7 @@ func_expr: func_name '(' ')' over_clause
1150511503
}
1150611504
| TRIM '(' BOTH trim_list ')'
1150711505
{
11508-
/* various trim expressions are defined in SQL92
11506+
/* various trim expressions are defined in SQL
1150911507
* - thomas 1997-07-19
1151011508
*/
1151111509
FuncCall *n = makeNode(FuncCall);
@@ -12208,7 +12206,7 @@ in_expr: select_with_parens
1220812206
;
1220912207

1221012208
/*
12211-
* Define SQL92-style case clause.
12209+
* Define SQL-style CASE clause.
1221212210
* - Full specification
1221312211
* CASE WHEN a = b THEN c ... ELSE d END
1221412212
* - Implicit argument

src/backend/parser/parse_relation.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static bool isQueryUsingTempRelation_walker(Node *node, void *context);
7070
* that (a) has no alias and (b) is for the same relation identified by
7171
* schemaname.refname. In this case we convert schemaname.refname to a
7272
* relation OID and search by relid, rather than by alias name. This is
73-
* peculiar, but it's what SQL92 says to do.
73+
* peculiar, but it's what SQL says to do.
7474
*/
7575
RangeTblEntry *
7676
refnameRangeTblEntry(ParseState *pstate,
@@ -353,7 +353,7 @@ searchRangeTableForRel(ParseState *pstate, RangeVar *relation)
353353
* Note: we assume that each given argument does not contain conflicts
354354
* itself; we just want to know if the two can be merged together.
355355
*
356-
* Per SQL92, two alias-less plain relation RTEs do not conflict even if
356+
* Per SQL, two alias-less plain relation RTEs do not conflict even if
357357
* they have the same eref->aliasname (ie, same relation name), if they
358358
* are for different relation OIDs (implying they are in different schemas).
359359
*
@@ -389,7 +389,7 @@ checkNameSpaceConflicts(ParseState *pstate, List *namespace1,
389389
if (rte1->rtekind == RTE_RELATION && rte1->alias == NULL &&
390390
rte2->rtekind == RTE_RELATION && rte2->alias == NULL &&
391391
rte1->relid != rte2->relid)
392-
continue; /* no conflict per SQL92 rule */
392+
continue; /* no conflict per SQL rule */
393393
ereport(ERROR,
394394
(errcode(ERRCODE_DUPLICATE_ALIAS),
395395
errmsg("table name \"%s\" specified more than once",

src/backend/parser/parse_utilcmd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static void setSchemaName(char *context_schema, char **stmt_schema_name);
133133
* will be the transformed CreateStmt, but there may be additional actions
134134
* to be done before and after the actual DefineRelation() call.
135135
*
136-
* SQL92 allows constraints to be scattered all over, so thumb through
136+
* SQL allows constraints to be scattered all over, so thumb through
137137
* the columns and collect all constraints into one place.
138138
* If there are any implied indices (e.g. UNIQUE or PRIMARY KEY)
139139
* then expand those into multiple IndexStmt blocks.
@@ -1405,7 +1405,7 @@ transformIndexConstraints(CreateStmtContext *cxt)
14051405
/*
14061406
* Scan the index list and remove any redundant index specifications. This
14071407
* can happen if, for instance, the user writes UNIQUE PRIMARY KEY. A
1408-
* strict reading of SQL92 would suggest raising an error instead, but
1408+
* strict reading of SQL would suggest raising an error instead, but
14091409
* that strikes me as too anal-retentive. - tgl 2001-02-14
14101410
*
14111411
* XXX in ALTER TABLE case, it'd be nice to look for duplicate
@@ -2691,7 +2691,7 @@ transformColumnType(CreateStmtContext *cxt, ColumnDef *column)
26912691
* that the logic we use for determining forward references is
26922692
* presently quite incomplete.
26932693
*
2694-
* SQL92 also allows constraints to make forward references, so thumb through
2694+
* SQL also allows constraints to make forward references, so thumb through
26952695
* the table columns and move forward references to a posterior alter-table
26962696
* command.
26972697
*

src/backend/tcop/pquery.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ DoPortalRunFetch(Portal portal,
16031603
forward = (fdirection == FETCH_FORWARD);
16041604

16051605
/*
1606-
* Zero count means to re-fetch the current row, if any (per SQL92)
1606+
* Zero count means to re-fetch the current row, if any (per SQL)
16071607
*/
16081608
if (count == 0)
16091609
{

src/backend/utils/adt/date.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-------------------------------------------------------------------------
22
*
33
* date.c
4-
* implements DATE and TIME data types specified in SQL-92 standard
4+
* implements DATE and TIME data types specified in SQL standard
55
*
66
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994-5, Regents of the University of California
@@ -1403,9 +1403,9 @@ time_smaller(PG_FUNCTION_ARGS)
14031403
PG_RETURN_TIMEADT((time1 < time2) ? time1 : time2);
14041404
}
14051405

1406-
/* overlaps_time() --- implements the SQL92 OVERLAPS operator.
1406+
/* overlaps_time() --- implements the SQL OVERLAPS operator.
14071407
*
1408-
* Algorithm is per SQL92 spec. This is much harder than you'd think
1408+
* Algorithm is per SQL spec. This is much harder than you'd think
14091409
* because the spec requires us to deliver a non-null answer in some cases
14101410
* where some of the inputs are null.
14111411
*/
@@ -2273,9 +2273,9 @@ timetz_mi_interval(PG_FUNCTION_ARGS)
22732273
PG_RETURN_TIMETZADT_P(result);
22742274
}
22752275

2276-
/* overlaps_timetz() --- implements the SQL92 OVERLAPS operator.
2276+
/* overlaps_timetz() --- implements the SQL OVERLAPS operator.
22772277
*
2278-
* Algorithm is per SQL92 spec. This is much harder than you'd think
2278+
* Algorithm is per SQL spec. This is much harder than you'd think
22792279
* because the spec requires us to deliver a non-null answer in some cases
22802280
* where some of the inputs are null.
22812281
*/

src/backend/utils/adt/datetime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1558,8 +1558,8 @@ DetermineTimeZoneOffset(struct pg_tm * tm, pg_tz *tzp)
15581558
* Returns 0 if successful, DTERR code if bogus input detected.
15591559
*
15601560
* Note that support for time zone is here for
1561-
* SQL92 TIME WITH TIME ZONE, but it reveals
1562-
* bogosity with SQL92 date/time standards, since
1561+
* SQL TIME WITH TIME ZONE, but it reveals
1562+
* bogosity with SQL date/time standards, since
15631563
* we must infer a time zone from current time.
15641564
* - thomas 2000-03-10
15651565
* Allow specifying date to get a better time zone,

src/backend/utils/adt/float.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,7 @@ float8_avg(PG_FUNCTION_ARGS)
19221922
sumX = transvalues[1];
19231923
/* ignore sumX2 */
19241924

1925-
/* SQL92 defines AVG of no values to be NULL */
1925+
/* SQL defines AVG of no values to be NULL */
19261926
if (N == 0.0)
19271927
PG_RETURN_NULL();
19281928

src/backend/utils/adt/like_match.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
* Keith Parks. <keith@mtcc.demon.co.uk>
4444
*
45-
* SQL92 lets you specify the escape character by saying
45+
* SQL lets you specify the escape character by saying
4646
* LIKE <pattern> ESCAPE <escape character>. We are a small operation
4747
* so we force you to use '\'. - ay 7/95
4848
*

src/backend/utils/adt/numeric.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2645,7 +2645,7 @@ numeric_avg(PG_FUNCTION_ARGS)
26452645
N = DatumGetNumeric(transdatums[0]);
26462646
sumX = DatumGetNumeric(transdatums[1]);
26472647

2648-
/* SQL92 defines AVG of no values to be NULL */
2648+
/* SQL defines AVG of no values to be NULL */
26492649
/* N is zero iff no digits (cf. numeric_uminus) */
26502650
if (NUMERIC_NDIGITS(N) == 0)
26512651
PG_RETURN_NULL();
@@ -2824,7 +2824,7 @@ numeric_stddev_pop(PG_FUNCTION_ARGS)
28242824
* purposes. (The latter two therefore don't really belong in this file,
28252825
* but we keep them here anyway.)
28262826
*
2827-
* Because SQL92 defines the SUM() of no values to be NULL, not zero,
2827+
* Because SQL defines the SUM() of no values to be NULL, not zero,
28282828
* the initial condition of the transition data value needs to be NULL. This
28292829
* means we can't rely on ExecAgg to automatically insert the first non-null
28302830
* data value into the transition data: it doesn't know how to do the type
@@ -3046,7 +3046,7 @@ int8_avg(PG_FUNCTION_ARGS)
30463046
elog(ERROR, "expected 2-element int8 array");
30473047
transdata = (Int8TransTypeData *) ARR_DATA_PTR(transarray);
30483048

3049-
/* SQL92 defines AVG of no values to be NULL */
3049+
/* SQL defines AVG of no values to be NULL */
30503050
if (transdata->count == 0)
30513051
PG_RETURN_NULL();
30523052

src/backend/utils/adt/timestamp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-------------------------------------------------------------------------
22
*
33
* timestamp.c
4-
* Functions for the built-in SQL92 types "timestamp" and "interval".
4+
* Functions for the built-in SQL types "timestamp" and "interval".
55
*
66
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
@@ -2276,9 +2276,9 @@ interval_hash(PG_FUNCTION_ARGS)
22762276
#endif
22772277
}
22782278

2279-
/* overlaps_timestamp() --- implements the SQL92 OVERLAPS operator.
2279+
/* overlaps_timestamp() --- implements the SQL OVERLAPS operator.
22802280
*
2281-
* Algorithm is per SQL92 spec. This is much harder than you'd think
2281+
* Algorithm is per SQL spec. This is much harder than you'd think
22822282
* because the spec requires us to deliver a non-null answer in some cases
22832283
* where some of the inputs are null.
22842284
*/
@@ -3129,7 +3129,7 @@ interval_avg(PG_FUNCTION_ARGS)
31293129
memcpy((void *) &sumX, DatumGetPointer(transdatums[0]), sizeof(Interval));
31303130
memcpy((void *) &N, DatumGetPointer(transdatums[1]), sizeof(Interval));
31313131

3132-
/* SQL92 defines AVG of no values to be NULL */
3132+
/* SQL defines AVG of no values to be NULL */
31333133
if (N.time == 0)
31343134
PG_RETURN_NULL();
31353135

src/backend/utils/adt/varlena.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -720,18 +720,18 @@ charlen_to_bytelen(const char *p, int n)
720720
* - string length
721721
*
722722
* If the starting position is zero or less, then return from the start of the string
723-
* adjusting the length to be consistent with the "negative start" per SQL92.
723+
* adjusting the length to be consistent with the "negative start" per SQL.
724724
* If the length is less than zero, return the remaining string.
725725
*
726726
* Added multibyte support.
727727
* - Tatsuo Ishii 1998-4-21
728-
* Changed behavior if starting position is less than one to conform to SQL92 behavior.
728+
* Changed behavior if starting position is less than one to conform to SQL behavior.
729729
* Formerly returned the entire string; now returns a portion.
730730
* - Thomas Lockhart 1998-12-10
731731
* Now uses faster TOAST-slicing interface
732732
* - John Gray 2002-02-22
733733
* Remove "#ifdef MULTIBYTE" and test for encoding_max_length instead. Change
734-
* behaviors conflicting with SQL92 to meet SQL92 (if E = S + L < S throw
734+
* behaviors conflicting with SQL to meet SQL (if E = S + L < S throw
735735
* error; if E < 1, return '', not entire string). Fixed MB related bug when
736736
* S > LC and < LC + 4 sometimes garbage characters are returned.
737737
* - Joe Conway 2002-08-10
@@ -1023,7 +1023,7 @@ text_overlay(text *t1, text *t2, int sp, int sl)
10231023
/*
10241024
* textpos -
10251025
* Return the position of the specified substring.
1026-
* Implements the SQL92 POSITION() function.
1026+
* Implements the SQL POSITION() function.
10271027
* Ref: A Guide To The SQL Standard, Date & Darwen, 1997
10281028
* - thomas 1997-07-27
10291029
*/
@@ -1903,7 +1903,7 @@ bytea_catenate(bytea *t1, bytea *t2)
19031903
* - string length (optional)
19041904
*
19051905
* If the starting position is zero or less, then return from the start of the string
1906-
* adjusting the length to be consistent with the "negative start" per SQL92.
1906+
* adjusting the length to be consistent with the "negative start" per SQL.
19071907
* If the length is less than zero, an ERROR is thrown. If no third argument
19081908
* (length) is provided, the length to the end of the string is assumed.
19091909
*/
@@ -2046,7 +2046,7 @@ bytea_overlay(bytea *t1, bytea *t2, int sp, int sl)
20462046
/*
20472047
* byteapos -
20482048
* Return the position of the specified substring.
2049-
* Implements the SQL92 POSITION() function.
2049+
* Implements the SQL POSITION() function.
20502050
* Cloned from textpos and modified as required.
20512051
*/
20522052
Datum

src/include/nodes/parsenodes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ typedef struct CreateStmt
15091509

15101510
typedef enum ConstrType /* types of constraints */
15111511
{
1512-
CONSTR_NULL, /* not SQL92, but a lot of people expect it */
1512+
CONSTR_NULL, /* not standard SQL, but a lot of people expect it */
15131513
CONSTR_NOTNULL,
15141514
CONSTR_DEFAULT,
15151515
CONSTR_CHECK,

src/include/utils/date.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*-------------------------------------------------------------------------
22
*
33
* date.h
4-
* Definitions for the SQL92 "date" and "time" types.
4+
* Definitions for the SQL "date" and "time" types.
55
*
66
*
77
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group

0 commit comments

Comments
 (0)