RETURN QUERY still does not work perfect in Postgres 8.4
| От | Michal Szymanski |
|---|---|
| Тема | RETURN QUERY still does not work perfect in Postgres 8.4 |
| Дата | |
| Msg-id | c81e0acb-f74c-450e-bdde-2c5014b32946@e21g2000yqb.googlegroups.com обсуждение исходный текст |
| Список | pgsql-bugs |
Try this:
=============================
DROP TABLE bug_table;
CREATE TABLE "bug_table" (
"id" BIGINT NOT NULL,
test VARCHAR,
CONSTRAINT "test_table_pkey" PRIMARY KEY("id")
) WITHOUT OIDS;
DROP FUNCTION buggy_procedure();
CREATE FUNCTION buggy_procedure() RETURNS SETOF bug_table
AS $$
BEGIN
-- @todo hide password
RETURN QUERY (
SELECT *
FROM bug_table
);
END;
$$
LANGUAGE plpgsql STRICT SECURITY DEFINER;
SELECT * FROM buggy_procedure(); -- All Okey
ALTER TABLE bug_table DROP COLUMN test;
SELECT * FROM buggy_procedure(); -- Bug
=========================
For our system this bug (or functionality) is a big problem. We cannot
drop table and import data for modified table - some table are huge
and sometimes there are many references.
I've tried to use RETURN TABLE but I have also problem with this:
http://groups.google.pl/group/pgsql.general/browse_thread/thread/a028c9ed2663b69b?hl=pl#
Michal Szymanski
http://blog.szymanskich.net
В списке pgsql-bugs по дате отправления: