Revision 11010
Added by Aaron Marcuse-Kubitza about 11 years ago
schemas/util.sql | ||
---|---|---|
1426 | 1426 |
COST 100 |
1427 | 1427 |
ROWS 1000 |
1428 | 1428 |
$$; |
1429 |
-- Also create subset function which turns off enable_sort |
|
1429 |
|
|
1430 |
PERFORM util.mk_subset_by_row_num_no_sort_func(view_); |
|
1431 |
END; |
|
1432 |
$_$; |
|
1433 |
|
|
1434 |
|
|
1435 |
-- |
|
1436 |
-- Name: mk_subset_by_row_num_no_sort_func(regclass); Type: FUNCTION; Schema: util; Owner: - |
|
1437 |
-- |
|
1438 |
|
|
1439 |
CREATE FUNCTION mk_subset_by_row_num_no_sort_func(view_ regclass) RETURNS void |
|
1440 |
LANGUAGE plpgsql STRICT |
|
1441 |
AS $_$ |
|
1442 |
DECLARE |
|
1443 |
view_qual_name text = util.qual_name(view_); |
|
1444 |
BEGIN |
|
1430 | 1445 |
EXECUTE $$ |
1431 | 1446 |
CREATE OR REPLACE FUNCTION $$||view_||$$(no_sort boolean, limit_ integer DEFAULT NULL::integer, offset_ integer DEFAULT NULL) |
1432 | 1447 |
RETURNS SETOF $$||view_||$$ |
... | ... | |
1451 | 1466 |
|
1452 | 1467 |
|
1453 | 1468 |
-- |
1469 |
-- Name: FUNCTION mk_subset_by_row_num_no_sort_func(view_ regclass); Type: COMMENT; Schema: util; Owner: - |
|
1470 |
-- |
|
1471 |
|
|
1472 |
COMMENT ON FUNCTION mk_subset_by_row_num_no_sort_func(view_ regclass) IS 'creates subset function which turns off enable_sort'; |
|
1473 |
|
|
1474 |
|
|
1475 |
-- |
|
1454 | 1476 |
-- Name: name(regtype); Type: FUNCTION; Schema: util; Owner: - |
1455 | 1477 |
-- |
1456 | 1478 |
|
Also available in: Unified diff
schemas/util.sql: mk_subset_by_row_num_func(): factored creation of no-sort subset function into mk_subset_by_row_num_no_sort_func() so it can be used by other functions