Revision 11835
Added by Aaron Marcuse-Kubitza about 11 years ago
util.sql | ||
---|---|---|
1129 | 1129 |
$_$; |
1130 | 1130 |
|
1131 | 1131 |
|
1132 |
SET default_tablespace = ''; |
|
1133 |
|
|
1134 |
SET default_with_oids = false; |
|
1135 |
|
|
1132 | 1136 |
-- |
1133 |
-- Name: explain2table(regclass, text); Type: FUNCTION; Schema: util; Owner: -
|
|
1137 |
-- Name: explain; Type: TABLE; Schema: util; Owner: -; Tablespace:
|
|
1134 | 1138 |
-- |
1135 | 1139 |
|
1136 |
CREATE FUNCTION explain2table(table_ regclass, sql text) RETURNS void |
|
1140 |
CREATE TABLE explain ( |
|
1141 |
line text NOT NULL |
|
1142 |
); |
|
1143 |
|
|
1144 |
|
|
1145 |
-- |
|
1146 |
-- Name: explain2table(text, regclass); Type: FUNCTION; Schema: util; Owner: - |
|
1147 |
-- |
|
1148 |
|
|
1149 |
CREATE FUNCTION explain2table(sql text, table_ regclass DEFAULT 'explain'::regclass) RETURNS void |
|
1137 | 1150 |
LANGUAGE sql |
1138 | 1151 |
AS $_$ |
1139 |
SELECT util.eval($$INSERT INTO $$||$1||$$ SELECT util.explain(
|
|
1140 |
$$||quote_nullable($2)||$$
|
|
1152 |
SELECT util.eval($$INSERT INTO $$||$2||$$ SELECT util.explain(
|
|
1153 |
$$||quote_nullable($1)||$$
|
|
1141 | 1154 |
)$$) |
1142 | 1155 |
$_$; |
1143 | 1156 |
|
... | ... | |
2339 | 2352 |
COMMENT ON OPERATOR ||% (text, text) IS '% indicates an identifier, as in Perl hashes and one of the x86 assembler syntaxes for registers'; |
2340 | 2353 |
|
2341 | 2354 |
|
2342 |
SET default_tablespace = ''; |
|
2343 |
|
|
2344 |
SET default_with_oids = false; |
|
2345 |
|
|
2346 | 2355 |
-- |
2347 |
-- Name: explain; Type: TABLE; Schema: util; Owner: -; Tablespace: |
|
2348 |
-- |
|
2349 |
|
|
2350 |
CREATE TABLE explain ( |
|
2351 |
line text NOT NULL |
|
2352 |
); |
|
2353 |
|
|
2354 |
|
|
2355 |
-- |
|
2356 | 2356 |
-- Name: map; Type: TABLE; Schema: util; Owner: -; Tablespace: |
2357 | 2357 |
-- |
2358 | 2358 |
|
Also available in: Unified diff
schemas/util.sql: explain2table(): by default, use the util.explain table