Re: function with a composite type calling another function - Mission Impossible?

From: "Riccardo G(dot) Facchini" <abief_ag_-postgresql(at)yahoo(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: function with a composite type calling another function - Mission Impossible?
Date: 2004-06-02 15:55:15
Message-ID: 20040602155515.53668.qmail@web13911.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

--- Tom Lane <__> wrote:
> "Riccardo G. Facchini" <__> writes:
> > declare my_new_complex complex_number;
>
> > select * from complex_to_complex(my_new_complex) into my_result;
>
> > ERROR: column "my_new_complex" does not exist
>
> plpgsql doesn't presently cope with passing whole-row variables into
> SQL
> expressions, which is essentially what you've got here. There's some
> chance it will work in time for 7.5.
>
> regards, tom lane

then, why
---
select * from complex_to_real(real_to_complex(1, 2));

select * from complex_to_complex(real_to_complex(1, 2));
---
work? and why the function definition:

CREATE or replace FUNCTION public.really_really_complex(complex_number)
RETURNS complex_number AS
'declare my_complex alias for $1;

declare my_result complex_number;

begin

my_result := complex_to_complex(my_complex);

return my_result;

end;'
LANGUAGE 'plpgsql' VOLATILE;
---

doesn't make a difference?

thanks for your quick answer,

=====
Riccardo G. Facchini

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Rajesh Kumar Mallah 2004-06-03 05:03:40 Re: Query becoming slower on adding a primary key
Previous Message Tom Lane 2004-06-02 15:43:59 Re: function with a composite type calling another function - Mission Impossible?