Re: [SQL] information_schema for all users

2006-07-09 Thread Michael Fuhr
On Sun, Jul 09, 2006 at 09:52:35AM +0200, Luca Giandoso wrote: > I wold like to make a plpgsql function that return column names and > their data types of a specific table. Do you have a reason for returning a cursor instead of SETOF some type? In versions prior to 8.1 you could create a custom t

[SQL] information_schema for all users

2006-07-09 Thread Luca Giandoso
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, dat