CREATE OR REPLACE FUNCTION delrow(tablename character varying, colname character varying, item integer) RETURNS void AS $BODY$ BEGIN EXECUTE ''DELETE FROM '' || quote_ident(tablename)::regclass || '' WHERE '' || quote_ident(colname) || ''=$1'' USING item; END; $BODY$ LANGUAGE plpgsql VOLATILE COST 100;