Solving NULL values are recognized as text-values within dynamic queries in PostgresSQL

Posted by Eric Bartels

I’ve written a dynamic query which is finally executed via EXECUTE my_dynamic_query; The query contained a select list in which two columns should always be NULL. — … stuff before dynamic_select_cols := ‘tbl1.foo, tbl1.bar, null AS theAlias1, null AS theAlias2, tbl2.foo2′; — … stuff after combining the dynamic queries EXECUTE my_dynamic_query; In my case the [...]

Value too long error in PostgreSQL inside a plpgsql-function

Posted by Eric Bartels

In an application I am working on I recently found errors in the applications log file. Value too long for type character varying(64) Within a function (written with plpgsql) a dynamic query is built and executed via sql-EXECUTE. The error PostgreSQL gives me stated out that the error was in the line containing the EXECUTE-statement. [...]