cancel
Showing results for 
Search instead for 
Did you mean: 

Does “subtype” work with EPAS ?

Question

How to find the Reserved SQL keywords in PG/EPAS ?

 

Answer

Using the below SQL query one can find the reserved SQL keywords in PostgreSQL/EPAS.
 
SELECT * FROM pg_get_keywords();
 

Question

Does “ subtype” work with EPAS ?
 
Answer 

PG/EPAS support omitting AS only for column labels that aren't any known keyword and SUBTYPE is an un-reserved keyword in EPAS - and that is the reason "SELECT now() subtype" query doesn't work. but if same being used with AS "SELECT now() AS subtype" that works.  So this is a known behavior and doesn’t have any work-around apart from using the AS or double quotes.
 
Community PostgreSQL :
 
postgres=# select * from pg_get_keywords() where word like '%subtype%' ;
 word | catcode | catdesc 
------+---------+---------
(0 rows)
postgres=# select now() subtype;
            subtype            
-------------------------------
 2019-03-22 08:47:58.033168-07
(1 row)
 
Advanced Server :
 
edb=# select * from pg_get_keywords() where word like '%subtype%' ;
  word   | catcode |  catdesc   
---------+---------+------------
 subtype | U       | unreserved
(1 row)
edb=# select now() subtype;
ERROR:  syntax error at or near "subtype"
LINE 1: select now() subtype;
                     ^
edb=# select now() "subtype";
             subtype              
----------------------------------
 22-MAR-19 09:24:20.268391 -07:00
(1 row)
edb=# select now() AS subtype;
             subtype              
----------------------------------
 22-MAR-19 09:24:25.325908 -07:00
(1 row)
Version history
Revision #:
5 of 5
Last update:
‎03-24-2019 10:29 AM
Updated by:
 
Labels (5)
Contributors