I think you need a space there:
EXECUTE 'TRUNCATE TABLE ' || quote_ident(tablename) || ' CASCADE;';
indeed, that is my fault - sorry
> EXCEPTIONIt's really a pretty bad idea to print your own message instead of using
> WHEN undefined_table THEN
> RAISE EXCEPTION 'Table "%" does not exists', tablename;
the system's message. In this case, you would have figured out the
problem immediately if you'd seen the real error message, which was
presumably bleating about "t1cascade".
Like always, it depends, custom error message has been required by Grace
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Regards,
Bartek
Bartek