information_schema for all users - Mailing list pgsql-sql

From Luca Giandoso
Subject information_schema for all users
Date
Msg-id 3ac7d4e0607090052v4e401a85k927b81b002149e88@mail.gmail.com
Whole thread Raw
Responses Re: information_schema for all users  (Michael Fuhr <mike@fuhr.org>)
List pgsql-sql
I wold like to make a plpgsql function that return column names and
their data types of a specific table.
I have done this using:

CREATE OR REPLACE FUNCTION _get_table_definition(refcursor) RETURNS
refcursor SECURITY DEFINER AS
$$
DECLARE
BEGIN   OPEN $1 FOR SELECT column_name as field_name, data_type as
field_type FROM information_schema.columns WHERE
table_name='_table_name';   RETURN $1;
END;
$$ LANGUAGE plpgsql;

but it works only with the database owner although i have used
"SECURITY DEFINER".
How can I make it works for everyone that calls the function?

I use PostgreSQL 8.1.4


pgsql-sql by date:

Previous
From: Richard Broersma Jr
Date:
Subject: Re: table joining duplicate records
Next
From: mbobi@mac.com
Date:
Subject: distinct with sum