dblink / plpgsql - definition list cheats for record returning functions?

Поиск
Список
Период
Сортировка
Искать

dblink / plpgsql - definition list cheats for record returning functions?

От:
Matthew Peter <survivedsushi@yahoo.com>
Дата:
Is there any way to use CREATE TYPE or an VIEW/TABLE defintion list instead of
manually defining it?



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail.
http://new.mail.yahoo.com

Re: dblink / plpgsql - definition list cheats for record

От:
Richard Huxton <dev@archonet.com>
Дата:
Matthew Peter wrote:
> Is there any way to use CREATE TYPE or an VIEW/TABLE defintion list instead of
> manually defining it?

Yes, just define your function as returning that type rather than 
RECORD. That way the calling context will know what to expect.

-- 
   Richard Huxton
   Archonet Ltd

Re: dblink / plpgsql - definition list cheats for record

От:
Matthew Peter <survivedsushi@yahoo.com>
Дата:

--- Richard Huxton  wrote:

> Matthew Peter wrote:
> > Is there any way to use CREATE TYPE or an VIEW/TABLE defintion list instead of
> > manually defining it?
> 
> Yes, just define your function as returning that type rather than 
> RECORD. That way the calling context will know what to expect.
> 

It's a dblink C function that returns RECORD so I just wanted to create a view or
type to help it reference the return data as ( TYPE )  rather than typing a
definition list as ( id integer, .. ) each time for each query.


 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index
FAQ