From: | Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | patch for EXECUTE .. INTO (from TODO) |
Date: | 2005-06-01 09:30:38 |
Message-ID: | Pine.LNX.4.44.0506011125210.27735-200000@kix.fsv.cvut.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
Hello
I did small trivial patch (almost all was written) for storing
result from executing dynamic query into ROW or RECORD variable.
CREATE TABLE fxx(i integer, y integer);
CREATE TYPE fxt AS (i integer, z integer);
CREATE OR REPLACE FUNCTION foo(varchar) RETURNS RECORD AS $$
DECLARE _r RECORD; _f fxx%ROWTYPE; _t fxt; z fxx;
BEGIN
DELETE FROM fxx;
EXECUTE 'INSERT INTO fxx VALUES(10,15)';
EXECUTE 'SELECT (row).* from (select row(10,1)::fxx)s' INTO _r;
RAISE NOTICE '%', _r.i;
EXECUTE 'SELECT * FROM '||$1||' LIMIT 1' INTO _f;
RETURN _f;
END; $$ LANGUAGE plpgsql;
SELECT foo('fxx');
pokus=# NOTICE: 10
foo
---------
(10,15)
(1 row)
Best regards
Pavel Stehule
Attachment | Content-Type | Size |
---|---|---|
executeinto.diff | text/plain | 5.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2005-06-01 13:09:32 | Re: patch for between symmetric, asymmetric (from TODO) |
Previous Message | Pavel Stehule | 2005-06-01 09:21:47 | patch for between symmetric, asymmetric (from TODO) |