Re: Stored Procedures
От | Joe Conway |
---|---|
Тема | Re: Stored Procedures |
Дата | |
Msg-id | 3D9B3650.3040000@joeconway.com обсуждение исходный текст |
Ответ на | Re: Stored Procedures (bcschnei@attbi.com) |
Ответы |
Complex SQL query and performance strategy
|
Список | pgsql-sql |
bcschnei@attbi.com wrote: > Ok, if this does not apply to versions prior to 7.3beta > then what do I need to do if I am running 7.2.1? When I > try to use the SETOF to retrun a row set, I only get > one column. First, prior to 7.3 there is no SCHEMA support in Postgres. Everything lives in essentially one and the same schema. In 7.2.x and before, returning a composite type (i.e. multiple columns) gives you back one column of pointers (large integer values) to the actual row of data. You can access the individual columns, but it's ugly: test=# CREATE TABLE foo (fooid int, foosubid int, fooname text); CREATE test=# INSERT INTO foo VALUES(1,1,'Joe'); INSERT 304822 1 test=# CREATE FUNCTION getfoo(int) RETURNS foo AS ' test'# SELECT * FROM foo WHERE fooid = $1; test'# ' LANGUAGE SQL; CREATE test=# select fooid(getfoo(1)), foosubid(getfoo(1)), fooname(getfoo(1)); fooid | foosubid | fooname -------+----------+--------- 1 | 1 | Joe (1 row) Joe
В списке pgsql-sql по дате отправления: