Re: 2 questions about types
От | Richard Huxton |
---|---|
Тема | Re: 2 questions about types |
Дата | |
Msg-id | 4238607E.8010704@archonet.com обсуждение исходный текст |
Ответ на | Re: 2 questions about types (Jason Tesser <jtesser@nbbc.edu>) |
Список | pgsql-general |
Jason Tesser wrote: > <snip> > >>There's an example in the manuals - chapter "7.2.1.4. Table Functions" >> >>SELECT * >> FROM dblink('dbname=mydb', 'select proname, prosrc from pg_proc') >> AS t1(proname name, prosrc text) >> WHERE proname LIKE 'bytea%'; >> >>So basically, you need to supply the type definitions in your SELECT if >>you aren't going to supply it in the function definition. > > > ok I tried to rewrite as follows but I get an error that says "a column > definition list is required fro functions returning record Because you didn't supply the type definitions in your SELECT... > here is my function and call for it now > CREATE OR REPLACE FUNCTION "public"."loginbyindidgettest" (integer) > RETURNS SETOF "pg_catalog"."record" AS' ... > select * from loginbyindidgettest(43650); This needs to be something like: SELECT * FROM loginbyindidgettest(43650) AS myres(a int, b text, c date, ...) Obviously, the types need to match the results of your function. -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления: