@ctredinnick will be able to help with this :)
Why not use instead:
COMMENT ON SCHEMA "my schema" IS LOCALTIMESTAMP(0);
Or if really want the current datetime truncated to current minute
COMMENT ON SCHEMA "my schema" IS DATE_TRUNC(‘minute’,LOCALTIMESTAMP());
Why not use instead:
COMMENT ON SCHEMA "my schema" IS LOCALTIMESTAMP(0);
Or if really want the current datetime truncated to current minute
COMMENT ON SCHEMA "my schema" IS DATE_TRUNC(‘minute’,LOCALTIMESTAMP());
I tried both examples (and other similar examples)
postgres throw an error using anything other than pure strings when setting commets. Thats why i need to use FME functions to inject the string directly into the SQL.
syntax error at or near "DATE_TRUNC"
Hmmm, been years since had a PostGreSQL instance to design on.
Alright well this is a hack to create a dynamic string literal using FORMAT() and give a value formatted to a string literal with the %L format flag.
FME_SQL_DELIMITER ;
DO $$
BEGIN
EXECUTE FORMAT('COMMENT ON SCHEMA “my schema” IS %L', TO_CHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DD HH:MM'));
END $$ LANGUAGE PLPGSQL;
Hmmm, been years since had a PostGreSQL instance to design on.
Alright well this is a hack to create a dynamic string literal using FORMAT() and give a value formatted to a string literal with the %L format flag.
FME_SQL_DELIMITER ;
DO $$
BEGIN
EXECUTE FORMAT('COMMENT ON SCHEMA “my schema” IS %L', TO_CHAR(CURRENT_TIMESTAMP, 'YYYY-MM-DD HH:MM'));
END $$ LANGUAGE PLPGSQL;
Thanks that worked! Thank you for the help :)