Buenas.
test=# SELECT (count(*)::integer > 0) FROM test ;
?column?
----------
f
(1 fila)
-- me funciona,
-- luego me equivoco en no_se_que ...
test=# CREATE OR REPLACE FUNCTION prueba(TEXT) RETURNS boolean AS
test-# $$
test$# EXECUTE 'SELECT (count(*)::integer > 0) FROM ' || $1;
test$# $$
test-# LANGUAGE sql;
ERROR: error de sintaxis en o cerca de «'SELECT (count(*)::integer > 0)
FROM '» at character 71
LINEA 3: EXECUTE 'SELECT (count(*)::integer > 0) FROM ' || $1;
^
-- en fuente monoespaciada, '^' marca la comilla simple de delante de SELECT
Donde me equivoco?
--
----o---( )---o----
Saludos de Victor Lopez Sabio
v(dot)lopez(dot)s(at)ono(dot)com
--------oooo--------