我如何在postgres上将日期参数传递给dblink?
SELECT * FROM dblink
(
'my connection'
,
'SELECT s.dtcreated FROM realvida.tbstudente s ' ||
' WHERE s.dtcreated' = $1 -- my parameter pass '02-01-2017'
) as result2( dtcreated date )
这样它就给我一个错误:
运算符不存在:date = integer
改变'SELECT s.dtcreated FROM realvida.tbstudente s ' ||
' WHERE s.dtcreated' = $1
至
format('SELECT s.dtcreated FROM realvida.tbstudente s WHERE s.dtcreated = %L',$1)