Re: Functions, composite types and Notice

From: "Hakan Kocaman" <Hakan(dot)Kocaman(at)digame(dot)de>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Functions, composite types and Notice
Date: 2007-02-02 15:41:24
Message-ID: 84AAD313D71B1D4F9EE20E739CC3B6ED016647BF@ATLANTIK-CL.intern.digame.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thanks Tom.

That did it.
Theirs always something to learn, when i read you.

Best regards

Hakan

> -----Original Message-----
> From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
> Sent: Friday, February 02, 2007 4:04 PM
> To: Hakan Kocaman
> Cc: pgsql-general(at)postgresql(dot)org
> Subject: Re: [GENERAL] Functions, composite types and Notice
>
>
> "Hakan Kocaman" <Hakan(dot)Kocaman(at)digame(dot)de> writes:
> >> Try this way instead:
> >> select * from public.check_notice(2,'hello');
>
> > so i call the function now like this (obfuscated):
> > select
> > public.check_notice(t1.a,t1.b,t2.c)
> > from
> > public.tab1 t1,
> > public.tab2 t2
>
> > I'm not clear how i can use the mentioned syntax with this kind of
> > query.
>
> No, you can't at the moment; you have to use the way you're doing it.
> There's been some speculation that SQL2003's LATERAL syntax might fix
> this problem, but no one's dug into it deeply enough to even be sure
> of that, let alone figure out what it'll take to implement it.
>
> If you're trying to avoid multiple evaluation of the
> function, the best
> way is to use "OFFSET 0" as an optimization fence to prevent
> flattening
> of a subquery. I get what seems to be the right thing from
>
> select (x).* from (select sumprod(f1,f2) as x from foo offset 0) ss;
>
> regards, tom lane
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-02-02 15:43:04 Re: Query optimization problem
Previous Message Merlin Moncure 2007-02-02 15:37:37 sql formatter/beautifier