Skip to content

Commit 8b60694

Browse files
committed
Add psql native funstions 'point' and 'polygon'
1 parent 653cd50 commit 8b60694

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/queryparser/postgresql/PostgreSQLLexer.g4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ OUTER : O_ U_ T_ E_ R_ ;
130130
PARTITION_SYM : P_ A_ R_ T_ I_ T_ I_ O_ N_ ;
131131
PDIST : P_ D_ I_ S_ T_ ;
132132
PI : P_ I_ ;
133+
POINT : P_ O_ I_ N_ T_ ;
134+
POLYGON : P_ O_ L_ Y_ G_ O_ N_ ;
133135
POSITION_SYM : P_ O_ S_ I_ T_ I_ O_ N_ ;
134136
POW : P_ O_ W_ ;
135137
POWER : P_ O_ W_ E_ R_ ;

src/queryparser/postgresql/PostgreSQLParser.g4

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ pg_sphere_op:
243243
| SNOTOVERLAP ;
244244

245245
sbit_expr:
246-
( pg_sphere_object | spoint )
246+
( polygon pg_sphere_op point )
247+
| ( pg_sphere_object | spoint )
247248
| ( ( spoint | simple_expr ) pg_sphere_op pg_sphere_object)
248249
| ( pg_sphere_object EQ pg_sphere_object )
249250
| ( pg_sphere_object pg_sphere_op pg_sphere_object )
@@ -255,6 +256,8 @@ sbit_expr:
255256
| ( ( spoint | scircle | sline | sellipse | spoly | spath | simple_expr ) ( ( PLUS | MINUS )? strans )+ ) ;
256257

257258

259+
polygon: POLYGON string_literal ;
260+
point: POINT LPAREN bit_expr COMMA bit_expr RPAREN ;
258261
spoint: SPOINT LPAREN bit_expr COMMA bit_expr RPAREN ;
259262
scircle: SCIRCLE LPAREN spoint COMMA bit_expr RPAREN ;
260263
sline: ( SLINE LPAREN spoint COMMA spoint RPAREN ) | ( SLINE LPAREN strans COMMA bit_expr RPAREN );

0 commit comments

Comments
 (0)