No function escape processing?

Поиск
Список
Период
Сортировка
Искать

No function escape processing?

От:
"Jason Sando" <jsando@claritysys.com>
Дата:
Is it intentional that the driver (7.3.4) doesn't do function escape
processing?

Eg:

  select * from mytable where {fn left(col_1, 1)} between 'A' and 'F'

results in:

	java.sql.SQLException: ERROR:  parser: parse error at or near "{"
	  at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)

It looks like AbstractJdbc1Statement.replaceProcessing(String p_sql) only
escapes time/date literals and passes everything else directly through.

Thanks,

- Jason Sando


Re: No function escape processing?

От:
Barry Lind <blind@xythos.com>
Дата:
Intentional in the sense that no one has stepped up to the plate to add 
support for other functions.  Feel free to submit a patch.

thanks,
--Barry


Jason Sando wrote:
> Is it intentional that the driver (7.3.4) doesn't do function escape
> processing?
> 
> Eg:
> 
>   select * from mytable where {fn left(col_1, 1)} between 'A' and 'F'
> 
> results in:
> 
> 	java.sql.SQLException: ERROR:  parser: parse error at or near "{"
> 	  at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
> 
> It looks like AbstractJdbc1Statement.replaceProcessing(String p_sql) only
> escapes time/date literals and passes everything else directly through.
> 
> Thanks,
> 
> - Jason Sando
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
> 


FAQ