Search Postgresql Archives

Re:

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 26 September 2009 1:10:20 pm Pavel Stehule wrote:
> Hello
>
> 2009/9/26 Adrian Klaver <aklaver@xxxxxxxxxxx>:
> > On Friday 25 September 2009 9:52:09 am Pavel Stehule wrote:
> >> Hello
> >>
> >> this isn't possible now. All what you want are limited by SELECT
> >> statement in PostgreSQL. Simply PL knows only  SELECT statement and
> >> structure of result have to be strongly static - because it is based
> >> on static execution plan - it is determined before query start.
> >>
> >> Statement CALL isn't implemented yet.
> >>
> >> Regards
> >> Pavel Stehule
> >
> > I may be misinterpreting the docs section below, but I beg to differ.
> >
> > http://www.postgresql.org/docs/8.4/interactive/plpgsql-statements.html#PL
> >PGSQL-STATEMENTS-EXECUTING-DYN
>
> the sql for EXECUTE statement should be dynamic, but the structure of
> result have to be stable.
>
> Pavel
>

RECORD type, RETURN RECORD ?

38.3.4. Record Types

name RECORD;

Record variables are similar to row-type variables, but they have no predefined 
structure. They take on the actual row structure of the row they are assigned 
during a SELECT or FOR command. The substructure of a record variable can 
change each time it is assigned to. A consequence of this is that until a 
record variable is first assigned to, it has no substructure, and any attempt 
to access a field in it will draw a run-time error.

Note that RECORD is not a true data type, only a placeholder. One should also 
realize that when a PL/pgSQL function is declared to return type record, this 
is not quite the same concept as a record variable, even though such a function 
might use a record variable to hold its result. In both cases the actual row 
structure is unknown when the function is written, but for a function returning 
record the actual structure is determined when the calling query is parsed, 
whereas a record variable can change its row structure on-the-fly. 


-- 
Adrian Klaver
aklaver@xxxxxxxxxxx

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux