On Wed, Sep 10, 2008 at 5:56 PM, Alvaro Herrera
<[EMAIL PROTECTED]> wrote:
> Ah, right, you only forgot to mention that other 99% of the
> requirements.
:)
> What's wrong with your first example?
It works, but those type casts "TRUE::BOOLEAN AS forwards" and selects
with "AS (email VARCHAR, backe
On Wed, Sep 10, 2008 at 5:43 PM, Filip Rembiałkowski
<[EMAIL PROTECTED]> wrote:
> nothing wrong here but this can also be rewritten to pure SQL function
> (can be few percent faster and optimizable by planner)
>
> CREATE OR REPLACE FUNCTION get_user_data( INT )
> RETURNS SETOF RECORD AS $$
> SELECT
Artis Caune escribió:
> Ops, forget to mention that this function is not so simple and use
> some plpgsql features.
Ah, right, you only forgot to mention that other 99% of the
requirements.
What's wrong with your first example?
--
Alvaro Herrerahttp://www.Comman
2008/9/10 Artis Caune <[EMAIL PROTECTED]>:
> Hi,
>
> What is the correct way of writing plpgsql function which needs return
> columns from multiple tables?
>
> e.x.:
> SELECT email FROM emails WHERE id = 1
> SELECT backend FROM backends WHERE id = 1
>
> I need plpgsql function return both email and
On Wed, Sep 10, 2008 at 5:26 PM, Alvaro Herrera
<[EMAIL PROTECTED]> wrote:
> Hmm, maybe
>
> select email, backend from emails, backends where email.id = 1 and
> backend.id = 1;
> ?
>
> You don't need a plpgsql function for this ...
Ops, forget to mention that this function is not so simple and use
Artis Caune escribió:
> Hi,
>
> What is the correct way of writing plpgsql function which needs return
> columns from multiple tables?
>
> e.x.:
> SELECT email FROM emails WHERE id = 1
> SELECT backend FROM backends WHERE id = 1
>
> I need plpgsql function return both email and backend in one li