Re: [GENERAL] Returns setof record PG/PLSQL

2005-08-14 Thread John Wells
On Sun, 2005-08-14 at 20:53 -0400, Tom Lane wrote: > regression=# create type table_count_result as (table_name text, count > bigint); > CREATE TYPE > regression=# create or replace function generate_table_count () > regression-# returns setof table_count_result as $$ > regression$#

Re: [GENERAL] Returns setof record PG/PLSQL

2005-08-14 Thread Jim Buttafuoco
--- From: John Wells <[EMAIL PROTECTED]> To: pgsql-general Sent: Sun, 14 Aug 2005 20:36:15 -0400 Subject: Re: [GENERAL] Returns setof record PG/PLSQL > On Sun, 2005-08-14 at 18:56 -0400, John Wells wrote: > > In my quest to create a function that counts rows for all user tables in &g

Re: [GENERAL] Returns setof record PG/PLSQL

2005-08-14 Thread Tom Lane
John Wells <[EMAIL PROTECTED]> writes: > In my quest to create a function that counts rows for all user tables in > the database, I've written the following: > -- > drop function generate_table_count (); > create or replace function generate_table_count () returns setof record > as ' > declare >

Re: [GENERAL] Returns setof record PG/PLSQL

2005-08-14 Thread John Wells
On Sun, 2005-08-14 at 18:56 -0400, John Wells wrote: > In my quest to create a function that counts rows for all user tables in > the database, I've written the following: Based on another example I've found, I've tried the two following variations (to no avail). Getting "ERROR: wrong record typ

[GENERAL] Returns setof record PG/PLSQL

2005-08-14 Thread John Wells
In my quest to create a function that counts rows for all user tables in the database, I've written the following: -- drop function generate_table_count (); create or replace function generate_table_count () returns setof record as ' declare tname record; count record; table text; begin