Revision 12651
Added by Aaron Marcuse-Kubitza almost 11 years ago
util.sql | ||
---|---|---|
2467 | 2467 |
|
2468 | 2468 |
|
2469 | 2469 |
-- |
2470 |
-- Name: populate_table(regclass, text); Type: FUNCTION; Schema: util; Owner: - |
|
2471 |
-- |
|
2472 |
|
|
2473 |
CREATE FUNCTION populate_table(table_ regclass, sql text) RETURNS void |
|
2474 |
LANGUAGE sql |
|
2475 |
AS $_$ |
|
2476 |
SELECT util.eval($$INSERT INTO $$||$1||$$ |
|
2477 |
$$||util.ltrim_nl($2)); |
|
2478 |
-- make sure the created table has the correct estimated row count |
|
2479 |
SELECT util.analyze_($1); |
|
2480 |
$_$; |
|
2481 |
|
|
2482 |
|
|
2483 |
-- |
|
2470 | 2484 |
-- Name: prefixed_name(text, anyelement); Type: FUNCTION; Schema: util; Owner: - |
2471 | 2485 |
-- |
2472 | 2486 |
|
Also available in: Unified diff
schemas/util.sql: added populate_table(regclass, text)