@@ -909,22 +909,25 @@ export class V13ToV14Transformer {
909909 return 'COERCE_EXPLICIT_CALL' ;
910910 }
911911
912+ if ( funcname . toLowerCase ( ) === 'substring' ) {
913+ return 'COERCE_SQL_SYNTAX' ;
914+ }
915+
916+ const explicitCallFunctions = [
917+ 'substr' , 'timestamptz' , 'timestamp' , 'date' , 'time' , 'timetz' ,
918+ 'interval' , 'numeric' , 'decimal' , 'float4' , 'float8' , 'int2' , 'int4' , 'int8' ,
919+ 'bool' , 'text' , 'varchar' , 'char' , 'bpchar'
920+ ] ;
921+
912922 const sqlSyntaxFunctions = [
913923 'btrim' , 'trim' , 'ltrim' , 'rtrim' ,
914924 'position' , 'overlay' ,
915- 'extract' ,
925+ 'extract' , 'timezone' ,
916926 'current_date' , 'current_time' , 'current_timestamp' ,
917927 'localtime' , 'localtimestamp' , 'overlaps'
918928 ] ;
919929
920- if ( funcname . toLowerCase ( ) === 'substr' ) {
921- return 'COERCE_EXPLICIT_CALL' ;
922- }
923-
924- if ( funcname . toLowerCase ( ) === 'substring' ) {
925- if ( this . isSqlStandardSyntax ( node , context ) ) {
926- return 'COERCE_SQL_SYNTAX' ;
927- }
930+ if ( explicitCallFunctions . includes ( funcname . toLowerCase ( ) ) ) {
928931 return 'COERCE_EXPLICIT_CALL' ;
929932 }
930933
0 commit comments