Revision 13456
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/schemas/util.sql | ||
---|---|---|
1805 | 1805 |
AS $_$ |
1806 | 1806 |
DECLARE |
1807 | 1807 |
PG_EXCEPTION_DETAIL text; |
1808 |
recreate_users_cmd text = util.save_drop_views(users);
|
|
1808 |
recreate_users_cmds text[] = util.save_drop_views(users);
|
|
1809 | 1809 |
BEGIN |
1810 | 1810 |
PERFORM util.eval(cmd); |
1811 |
PERFORM util.eval(recreate_users_cmd); |
|
1811 |
PERFORM util.eval(recreate_users_cmds);
|
|
1812 | 1812 |
EXCEPTION |
1813 | 1813 |
WHEN dependent_objects_still_exist THEN |
1814 | 1814 |
IF users IS NOT NULL THEN RAISE; END IF; -- save_drop_views() didn't fix it |
... | ... | |
3349 | 3349 |
-- Name: save_drop_views(text[]); Type: FUNCTION; Schema: util; Owner: - |
3350 | 3350 |
-- |
3351 | 3351 |
|
3352 |
CREATE FUNCTION save_drop_views(views text[]) RETURNS text |
|
3352 |
CREATE FUNCTION save_drop_views(views text[]) RETURNS text[]
|
|
3353 | 3353 |
LANGUAGE sql |
3354 | 3354 |
AS $_$ |
3355 |
SELECT string_agg(util.save_drop_view(unnest), '') FROM unnest($1)
|
|
3355 |
SELECT array(SELECT util.save_drop_view(view_) FROM unnest($1) view_)
|
|
3356 | 3356 |
$_$; |
3357 | 3357 |
|
3358 | 3358 |
|
Also available in: Unified diff
schemas/util.sql: save_drop_views(): return text[] instead of concatenated text so that the queries will be run individually and be easier to debug