Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
8b84aebd
Commit
8b84aebd
authored
Jun 14, 2005
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BETWEEN SYMMETRIC.
Pavel Stehule
parent
495f9aa0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
11 deletions
+50
-11
doc/src/sgml/func.sgml
doc/src/sgml/func.sgml
+7
-1
src/backend/parser/gram.y
src/backend/parser/gram.y
+40
-9
src/backend/parser/keywords.c
src/backend/parser/keywords.c
+3
-1
No files found.
doc/src/sgml/func.sgml
View file @
8b84aebd
<!--
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.25
5 2005/06/14 21:04:38
momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.25
6 2005/06/14 23:47:39
momjian Exp $
PostgreSQL documentation
-->
...
...
@@ -282,6 +282,12 @@ PostgreSQL documentation
There is no difference between the two respective forms apart from
the <acronym>CPU</acronym> cycles required to rewrite the first one
into the second one internally.
<indexterm>
<primary>BETWEEN SYMETRIC</primary>
</indexterm>
<token>BETWEEN SYMMETRIC</> is the same as <literal>BETWEEN</>
except there is no requirement that the argument to the left of <literal>AND</> be less than
or equal to the argument on the right; the proper range is automatically determined.
</para>
<para>
...
...
src/backend/parser/gram.y
View file @
8b84aebd
...
...
@@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.49
2 2005/06/08 21:15:28 tgl
Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.49
3 2005/06/14 23:47:39 momjian
Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
...
...
@@ -338,7 +338,7 @@ static void doNegateFloat(Value *v);
/* ordinary key words in alphabetical order */
%token <keyword> ABORT_P ABSOLUTE_P ACCESS ACTION ADD AFTER
AGGREGATE ALL ALSO ALTER ANALYSE ANALYZE AND ANY ARRAY AS ASC
ASSERTION ASSIGNMENT AT AUTHORIZATION
ASSERTION ASSIGNMENT A
SYMMETRIC A
T AUTHORIZATION
BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
BOOLEAN_P BOTH BY
...
...
@@ -399,7 +399,8 @@ static void doNegateFloat(Value *v);
SAVEPOINT SCHEMA SCROLL SECOND_P SECURITY SELECT SEQUENCE
SERIALIZABLE SESSION SESSION_USER SET SETOF SHARE
SHOW SIMILAR SIMPLE SMALLINT SOME STABLE START STATEMENT
STATISTICS STDIN STDOUT STORAGE STRICT_P SUBSTRING SYSID
STATISTICS STDIN STDOUT STORAGE STRICT_P SUBSTRING SYMMETRIC
SYSID
TABLE TABLESPACE TEMP TEMPLATE TEMPORARY THEN TIME TIMESTAMP
TO TOAST TRAILING TRANSACTION TREAT TRIGGER TRIM TRUE_P
...
...
@@ -6333,18 +6334,41 @@ a_expr: c_expr { $$ = $1; }
{
$$ = (Node *) makeSimpleA_Expr(AEXPR_OF, "!=", $1, (Node *) $6);
}
| a_expr BETWEEN b_expr AND b_expr %prec BETWEEN
| a_expr BETWEEN
opt_asymmetric
b_expr AND b_expr %prec BETWEEN
{
$$ = (Node *) makeA_Expr(AEXPR_AND, NIL,
(Node *) makeSimpleA_Expr(AEXPR_OP, ">=", $1, $
3
),
(Node *) makeSimpleA_Expr(AEXPR_OP, "<=", $1, $
5
));
(Node *) makeSimpleA_Expr(AEXPR_OP, ">=", $1, $
4
),
(Node *) makeSimpleA_Expr(AEXPR_OP, "<=", $1, $
6
));
}
| a_expr NOT BETWEEN b_expr AND b_expr %prec BETWEEN
| a_expr NOT BETWEEN
opt_asymmetric
b_expr AND b_expr %prec BETWEEN
{
$$ = (Node *) makeA_Expr(AEXPR_OR, NIL,
(Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $
4
),
(Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $
6
));
(Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $
5
),
(Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $
7
));
}
| a_expr BETWEEN SYMMETRIC b_expr AND b_expr %prec BETWEEN
{
$$ = (Node *) makeA_Expr(AEXPR_OR, NIL,
(Node *) makeA_Expr(AEXPR_AND, NIL,
(Node *) makeSimpleA_Expr(AEXPR_OP, ">=", $1, $4),
(Node *) makeSimpleA_Expr(AEXPR_OP, "<=", $1, $6)),
(Node *) makeA_Expr(AEXPR_AND, NIL,
(Node *) makeSimpleA_Expr(AEXPR_OP, ">=", $1, $6),
(Node *) makeSimpleA_Expr(AEXPR_OP, "<=", $1, $4)));
}
| a_expr NOT BETWEEN SYMMETRIC b_expr AND b_expr %prec BETWEEN
{
$$ = (Node *) makeA_Expr(AEXPR_AND, NIL,
(Node *) makeA_Expr(AEXPR_OR, NIL,
(Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $5),
(Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $7)),
(Node *) makeA_Expr(AEXPR_OR, NIL,
(Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $7),
(Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $5)));
}
| a_expr IN_P in_expr
{
/* in_expr returns a SubLink or a list of a_exprs */
...
...
@@ -6443,6 +6467,11 @@ a_expr: c_expr { $$ = $1; }
}
;
opt_asymmetric: ASYMMETRIC {}
| /*EMPTY*/ {}
;
/*
* Restricted expressions
*
...
...
@@ -7721,6 +7750,7 @@ unreserved_keyword:
| ALTER
| ASSERTION
| ASSIGNMENT
| ASYMMETRIC
| AT
| BACKWARD
| BEFORE
...
...
@@ -7867,6 +7897,7 @@ unreserved_keyword:
| STDIN
| STDOUT
| STORAGE
| SYMMETRIC
| SYSID
| STRICT_P
| TABLESPACE
...
...
src/backend/parser/keywords.c
View file @
8b84aebd
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.15
5 2005/05/07 02:22:47
momjian Exp $
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.15
6 2005/06/14 23:47:39
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -49,6 +49,7 @@ static const ScanKeyword ScanKeywords[] = {
{
"asc"
,
ASC
},
{
"assertion"
,
ASSERTION
},
{
"assignment"
,
ASSIGNMENT
},
{
"asymmetric"
,
ASYMMETRIC
},
{
"at"
,
AT
},
{
"authorization"
,
AUTHORIZATION
},
{
"backward"
,
BACKWARD
},
...
...
@@ -296,6 +297,7 @@ static const ScanKeyword ScanKeywords[] = {
{
"storage"
,
STORAGE
},
{
"strict"
,
STRICT_P
},
{
"substring"
,
SUBSTRING
},
{
"symmetric"
,
SYMMETRIC
},
{
"sysid"
,
SYSID
},
{
"table"
,
TABLE
},
{
"tablespace"
,
TABLESPACE
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment