return false;
/*
- * For SQL92 compatibility, '+' and '-' cannot be the last char of a
+ * For SQL standard compatibility, '+' and '-' cannot be the last char of a
* multi-char operator unless the operator contains chars that are not in
- * SQL92 operators. The idea is to lex '=-' as two operators, but not to
- * forbid operator names like '?-' that could not be sequences of SQL92
+ * SQL operators. The idea is to lex '=-' as two operators, but not to
+ * forbid operator names like '?-' that could not be sequences of standard SQL
* operators.
*/
if (len > 1 &&
qual = resultRelInfo->ri_ConstraintExprs[i];
/*
- * NOTE: SQL92 specifies that a NULL result from a constraint
+ * NOTE: SQL specifies that a NULL result from a constraint
* expression is not to be treated as a failure. Therefore, tell
* ExecQual to return TRUE for NULL.
*/
* NOTES
* CAPITALS are used to represent terminal symbols.
* non-capitals are used to represent non-terminals.
- * SQL92-specific syntax is separated from plain SQL/Postgres syntax
- * to help isolate the non-extensible portions of the parser.
*
* In general, nothing in this file should initiate database accesses
* nor depend on changeable state (such as SET variables). If you do
*
* Set PG internal variable
* SET name TO 'var_value'
- * Include SQL92 syntax (thomas 1997-10-22):
+ * Include SQL syntax (thomas 1997-10-22):
* SET TIME ZONE 'var_value'
*
*****************************************************************************/
* to make it explicit.
* - thomas 1998-09-13
*
- * WITH NULL and NULL are not SQL92-standard syntax elements,
+ * WITH NULL and NULL are not SQL-standard syntax elements,
* so leave them out. Use DEFAULT NULL to explicitly indicate
* that a column may have that value. WITH NULL leads to
* shift/reduce conflicts with WITH TIME ZONE anyway.
* As with select_no_parens, simple_select cannot have outer parentheses,
* but can have parenthesized subclauses.
*
- * Note that sort clauses cannot be included at this level --- SQL92 requires
+ * Note that sort clauses cannot be included at this level --- SQL requires
* SELECT foo UNION SELECT bar ORDER BY baz
* to be parsed as
* (SELECT foo UNION SELECT bar) ORDER BY baz
/*
* It may seem silly to separate joined_table from table_ref, but there is
- * method in SQL92's madness: if you don't do it this way you get reduce-
+ * method in SQL's madness: if you don't do it this way you get reduce-
* reduce conflicts, because it's not clear to the parser generator whether
* to expect alias_clause after ')' or not. For the same reason we must
* treat 'JOIN' and 'join_type JOIN' separately, rather than allowing
/*****************************************************************************
*
* Type syntax
- * SQL92 introduces a large amount of type-specific syntax.
+ * SQL introduces a large amount of type-specific syntax.
* Define individual clauses to handle these cases, and use
* the generic case to handle regular type-extensible Postgres syntax.
* - thomas 1997-10-10
;
/*
- * SQL92 numeric data types
+ * SQL numeric data types
*/
Numeric: INT_P
{
;
/*
- * SQL92 bit-field data types
+ * SQL bit-field data types
* The following implements BIT() and BIT VARYING().
*/
Bit: BitWithLength
/*
- * SQL92 character data types
+ * SQL character data types
* The following implements CHAR() and VARCHAR().
*/
Character: CharacterWithLength
;
/*
- * SQL92 date/time types
+ * SQL date/time types
*/
ConstDatetime:
TIMESTAMP '(' Iconst ')' opt_timezone
}
/* NullTest clause
- * Define SQL92-style Null test clause.
+ * Define SQL-style Null test clause.
* Allow two forms described in the standard:
* a IS NULL
* a IS NOT NULL
/*
* We consider AGGREGATE(*) to invoke a parameterless
* aggregate. This does the right thing for COUNT(*),
- * and there are no other aggregates in SQL92 that accept
+ * and there are no other aggregates in SQL that accept
* '*' as parameter.
*
* The FuncCall node is also marked agg_star = true,
}
| TRIM '(' BOTH trim_list ')'
{
- /* various trim expressions are defined in SQL92
+ /* various trim expressions are defined in SQL
* - thomas 1997-07-19
*/
FuncCall *n = makeNode(FuncCall);
;
/*
- * Define SQL92-style case clause.
+ * Define SQL-style CASE clause.
* - Full specification
* CASE WHEN a = b THEN c ... ELSE d END
* - Implicit argument
* that (a) has no alias and (b) is for the same relation identified by
* schemaname.refname. In this case we convert schemaname.refname to a
* relation OID and search by relid, rather than by alias name. This is
- * peculiar, but it's what SQL92 says to do.
+ * peculiar, but it's what SQL says to do.
*/
RangeTblEntry *
refnameRangeTblEntry(ParseState *pstate,
* Note: we assume that each given argument does not contain conflicts
* itself; we just want to know if the two can be merged together.
*
- * Per SQL92, two alias-less plain relation RTEs do not conflict even if
+ * Per SQL, two alias-less plain relation RTEs do not conflict even if
* they have the same eref->aliasname (ie, same relation name), if they
* are for different relation OIDs (implying they are in different schemas).
*
if (rte1->rtekind == RTE_RELATION && rte1->alias == NULL &&
rte2->rtekind == RTE_RELATION && rte2->alias == NULL &&
rte1->relid != rte2->relid)
- continue; /* no conflict per SQL92 rule */
+ continue; /* no conflict per SQL rule */
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_ALIAS),
errmsg("table name \"%s\" specified more than once",
* will be the transformed CreateStmt, but there may be additional actions
* to be done before and after the actual DefineRelation() call.
*
- * SQL92 allows constraints to be scattered all over, so thumb through
+ * SQL allows constraints to be scattered all over, so thumb through
* the columns and collect all constraints into one place.
* If there are any implied indices (e.g. UNIQUE or PRIMARY KEY)
* then expand those into multiple IndexStmt blocks.
/*
* Scan the index list and remove any redundant index specifications. This
* can happen if, for instance, the user writes UNIQUE PRIMARY KEY. A
- * strict reading of SQL92 would suggest raising an error instead, but
+ * strict reading of SQL would suggest raising an error instead, but
* that strikes me as too anal-retentive. - tgl 2001-02-14
*
* XXX in ALTER TABLE case, it'd be nice to look for duplicate
* that the logic we use for determining forward references is
* presently quite incomplete.
*
- * SQL92 also allows constraints to make forward references, so thumb through
+ * SQL also allows constraints to make forward references, so thumb through
* the table columns and move forward references to a posterior alter-table
* command.
*
forward = (fdirection == FETCH_FORWARD);
/*
- * Zero count means to re-fetch the current row, if any (per SQL92)
+ * Zero count means to re-fetch the current row, if any (per SQL)
*/
if (count == 0)
{
/*-------------------------------------------------------------------------
*
* date.c
- * implements DATE and TIME data types specified in SQL-92 standard
+ * implements DATE and TIME data types specified in SQL standard
*
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
* Portions Copyright (c) 1994-5, Regents of the University of California
PG_RETURN_TIMEADT((time1 < time2) ? time1 : time2);
}
-/* overlaps_time() --- implements the SQL92 OVERLAPS operator.
+/* overlaps_time() --- implements the SQL OVERLAPS operator.
*
- * Algorithm is per SQL92 spec. This is much harder than you'd think
+ * Algorithm is per SQL spec. This is much harder than you'd think
* because the spec requires us to deliver a non-null answer in some cases
* where some of the inputs are null.
*/
PG_RETURN_TIMETZADT_P(result);
}
-/* overlaps_timetz() --- implements the SQL92 OVERLAPS operator.
+/* overlaps_timetz() --- implements the SQL OVERLAPS operator.
*
- * Algorithm is per SQL92 spec. This is much harder than you'd think
+ * Algorithm is per SQL spec. This is much harder than you'd think
* because the spec requires us to deliver a non-null answer in some cases
* where some of the inputs are null.
*/
* Returns 0 if successful, DTERR code if bogus input detected.
*
* Note that support for time zone is here for
- * SQL92 TIME WITH TIME ZONE, but it reveals
- * bogosity with SQL92 date/time standards, since
+ * SQL TIME WITH TIME ZONE, but it reveals
+ * bogosity with SQL date/time standards, since
* we must infer a time zone from current time.
* - thomas 2000-03-10
* Allow specifying date to get a better time zone,
sumX = transvalues[1];
/* ignore sumX2 */
- /* SQL92 defines AVG of no values to be NULL */
+ /* SQL defines AVG of no values to be NULL */
if (N == 0.0)
PG_RETURN_NULL();
*
* Keith Parks. <keith@mtcc.demon.co.uk>
*
- * SQL92 lets you specify the escape character by saying
+ * SQL lets you specify the escape character by saying
* LIKE <pattern> ESCAPE <escape character>. We are a small operation
* so we force you to use '\'. - ay 7/95
*
N = DatumGetNumeric(transdatums[0]);
sumX = DatumGetNumeric(transdatums[1]);
- /* SQL92 defines AVG of no values to be NULL */
+ /* SQL defines AVG of no values to be NULL */
/* N is zero iff no digits (cf. numeric_uminus) */
if (NUMERIC_NDIGITS(N) == 0)
PG_RETURN_NULL();
* purposes. (The latter two therefore don't really belong in this file,
* but we keep them here anyway.)
*
- * Because SQL92 defines the SUM() of no values to be NULL, not zero,
+ * Because SQL defines the SUM() of no values to be NULL, not zero,
* the initial condition of the transition data value needs to be NULL. This
* means we can't rely on ExecAgg to automatically insert the first non-null
* data value into the transition data: it doesn't know how to do the type
elog(ERROR, "expected 2-element int8 array");
transdata = (Int8TransTypeData *) ARR_DATA_PTR(transarray);
- /* SQL92 defines AVG of no values to be NULL */
+ /* SQL defines AVG of no values to be NULL */
if (transdata->count == 0)
PG_RETURN_NULL();
/*-------------------------------------------------------------------------
*
* timestamp.c
- * Functions for the built-in SQL92 types "timestamp" and "interval".
+ * Functions for the built-in SQL types "timestamp" and "interval".
*
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
#endif
}
-/* overlaps_timestamp() --- implements the SQL92 OVERLAPS operator.
+/* overlaps_timestamp() --- implements the SQL OVERLAPS operator.
*
- * Algorithm is per SQL92 spec. This is much harder than you'd think
+ * Algorithm is per SQL spec. This is much harder than you'd think
* because the spec requires us to deliver a non-null answer in some cases
* where some of the inputs are null.
*/
memcpy((void *) &sumX, DatumGetPointer(transdatums[0]), sizeof(Interval));
memcpy((void *) &N, DatumGetPointer(transdatums[1]), sizeof(Interval));
- /* SQL92 defines AVG of no values to be NULL */
+ /* SQL defines AVG of no values to be NULL */
if (N.time == 0)
PG_RETURN_NULL();
* - string length
*
* If the starting position is zero or less, then return from the start of the string
- * adjusting the length to be consistent with the "negative start" per SQL92.
+ * adjusting the length to be consistent with the "negative start" per SQL.
* If the length is less than zero, return the remaining string.
*
* Added multibyte support.
* - Tatsuo Ishii 1998-4-21
- * Changed behavior if starting position is less than one to conform to SQL92 behavior.
+ * Changed behavior if starting position is less than one to conform to SQL behavior.
* Formerly returned the entire string; now returns a portion.
* - Thomas Lockhart 1998-12-10
* Now uses faster TOAST-slicing interface
* - John Gray 2002-02-22
* Remove "#ifdef MULTIBYTE" and test for encoding_max_length instead. Change
- * behaviors conflicting with SQL92 to meet SQL92 (if E = S + L < S throw
+ * behaviors conflicting with SQL to meet SQL (if E = S + L < S throw
* error; if E < 1, return '', not entire string). Fixed MB related bug when
* S > LC and < LC + 4 sometimes garbage characters are returned.
* - Joe Conway 2002-08-10
/*
* textpos -
* Return the position of the specified substring.
- * Implements the SQL92 POSITION() function.
+ * Implements the SQL POSITION() function.
* Ref: A Guide To The SQL Standard, Date & Darwen, 1997
* - thomas 1997-07-27
*/
* - string length (optional)
*
* If the starting position is zero or less, then return from the start of the string
- * adjusting the length to be consistent with the "negative start" per SQL92.
+ * adjusting the length to be consistent with the "negative start" per SQL.
* If the length is less than zero, an ERROR is thrown. If no third argument
* (length) is provided, the length to the end of the string is assumed.
*/
/*
* byteapos -
* Return the position of the specified substring.
- * Implements the SQL92 POSITION() function.
+ * Implements the SQL POSITION() function.
* Cloned from textpos and modified as required.
*/
Datum
typedef enum ConstrType /* types of constraints */
{
- CONSTR_NULL, /* not SQL92, but a lot of people expect it */
+ CONSTR_NULL, /* not standard SQL, but a lot of people expect it */
CONSTR_NOTNULL,
CONSTR_DEFAULT,
CONSTR_CHECK,
/*-------------------------------------------------------------------------
*
* date.h
- * Definitions for the SQL92 "date" and "time" types.
+ * Definitions for the SQL "date" and "time" types.
*
*
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
/*-------------------------------------------------------------------------
*
* timestamp.h
- * Definitions for the SQL92 "timestamp" and "interval" types.
+ * Definitions for the SQL "timestamp" and "interval" types.
*
* Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
* In order to make the world safe for Windows and Mac clients as well as
* Unix ones, we accept either \n or \r as a newline. A DOS-style \r\n
* sequence will be seen as two successive newlines, but that doesn't cause
- * any problems. SQL92-style comments, which start with -- and extend to the
+ * any problems. SQL-style comments, which start with -- and extend to the
* next newline, are treated as equivalent to a single whitespace character.
*
* NOTE a fine point: if there is no newline following --, we will absorb
whitespace ({space}+|{comment})
/*
- * SQL92 requires at least one newline in the whitespace separating
+ * SQL requires at least one newline in the whitespace separating
* string literals that are to be concatenated. Silly, but who are we
* to argue? Note that {whitespace_with_newline} should not have * after
* it, whereas {whitespace} should generally have a * after it...
(16 rows)
--
--- SQL92 syntax
+-- SQL syntax
-- Try all combinations to ensure that we get nothing when we expect nothing
-- - thomas 2000-01-04
--
--
-- NULLIF() and COALESCE()
-- Shorthand forms for typical CASE constructs
--- defined in the SQL92 standard.
+-- defined in the SQL standard.
--
SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
i | f
-- STRINGS
-- Test various data entry syntaxes.
--
--- SQL92 string continuation syntax
+-- SQL string continuation syntax
-- E021-03 character string literals
SELECT 'first line'
' - next line'
(1 row)
--
--- test SQL92 string functions
+-- test SQL string functions
-- E### and T### are feature reference numbers from SQL99
--
-- E021-09 trim function
insert into toasttest values(repeat('1234567890',10000));
insert into toasttest values(repeat('1234567890',10000));
-- If the starting position is zero or less, then return from the start of the string
--- adjusting the length to be consistent with the "negative start" per SQL92.
+-- adjusting the length to be consistent with the "negative start" per SQL.
SELECT substr(f1, -1, 5) from toasttest;
substr
--------
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
-- If the starting position is zero or less, then return from the start of the string
--- adjusting the length to be consistent with the "negative start" per SQL92.
+-- adjusting the length to be consistent with the "negative start" per SQL.
SELECT substr(f1, -1, 5) from toasttest;
substr
--------
SELECT 'eight' AS one, currval('insert_seq');
--- According to SQL92, it is OK to insert a record that gives rise to NULL
+-- According to SQL, it is OK to insert a record that gives rise to NULL
-- constraint-condition results. Postgres used to reject this, but it
-- was wrong:
INSERT INTO INSERT_TBL VALUES (null, null, null);
eight | 8
(1 row)
--- According to SQL92, it is OK to insert a record that gives rise to NULL
+-- According to SQL, it is OK to insert a record that gives rise to NULL
-- constraint-condition results. Postgres used to reject this, but it
-- was wrong:
INSERT INTO INSERT_TBL VALUES (null, null, null);
ORDER BY BOOLTBL1.f1, BOOLTBL2.f1;
--
--- SQL92 syntax
+-- SQL syntax
-- Try all combinations to ensure that we get nothing when we expect nothing
-- - thomas 2000-01-04
--
--
-- NULLIF() and COALESCE()
-- Shorthand forms for typical CASE constructs
--- defined in the SQL92 standard.
+-- defined in the SQL standard.
--
SELECT * FROM CASE_TBL WHERE COALESCE(f,i) = 4;
-- Test various data entry syntaxes.
--
--- SQL92 string continuation syntax
+-- SQL string continuation syntax
-- E021-03 character string literals
SELECT 'first line'
' - next line'
SELECT CAST(name 'namefield' AS varchar) AS "varchar(name)";
--
--- test SQL92 string functions
+-- test SQL string functions
-- E### and T### are feature reference numbers from SQL99
--
insert into toasttest values(repeat('1234567890',10000));
-- If the starting position is zero or less, then return from the start of the string
--- adjusting the length to be consistent with the "negative start" per SQL92.
+-- adjusting the length to be consistent with the "negative start" per SQL.
SELECT substr(f1, -1, 5) from toasttest;
-- If the length is less than zero, an ERROR is thrown.
insert into toasttest values(decode(repeat('1234567890',10000),'escape'));
-- If the starting position is zero or less, then return from the start of the string
--- adjusting the length to be consistent with the "negative start" per SQL92.
+-- adjusting the length to be consistent with the "negative start" per SQL.
SELECT substr(f1, -1, 5) from toasttest;
-- If the length is less than zero, an ERROR is thrown.