New answers tagged

2

Dynamically creating multiple triggers for individual rows sounds quite nasty. This is not likely to scale well. After reading your update I would suggest you implement 1 trigger that fires for all CRUD operations on the SELLS table. This trigger checks to see if the modified rows of SELLS are in the SUBSCRIPTION table. If they are send a notification, if ...


1

Let's suppose for country_name you wanted to do a leading and trailing wildcard search. You don't need dynamic SQL for this. Just: CREATE OR REPLACE FUNCTION report_get_countries_new (_pattern text) RETURNS SETOF lookups.countries AS $func$ SELECT * FROM lookups.countries WHERE country_name LIKE '%' || _pattern || '%' $func$ LANGUAGE sql; ...



Top 50 recent answers are included