return multiple rows - Mailing list pgsql-general

From Rakotomandimby Mihamina
Subject return multiple rows
Date
Msg-id 4AAA6480.5020003@gulfsat.mg
Whole thread Raw
Responses Re: return multiple rows  (Rakotomandimby Mihamina <mihamina@gulfsat.mg>)
Re: return multiple rows  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
Hi all,
I have a FUNCTION queried like this:
   SELECT * FROM f_authorize_check_query2('%{SQL-User-Name}','%{User-Password}' [...];

Built this way:
   CREATE FUNCTION f_authorize_check_query2(...)  RETURNS radcheck
     AS $_$
    DECLARE
        [...]
        v_ret radcheck%ROWTYPE;
        [...]
           SELECT  INTO v_ret '111',username,'Cleartext-Password',pwd,':=' FROM [...]
    RETURN v_ret;
    END;
   $_$
   LANGUAGE plpgsql;

It returns only one row, like this:
     +----+----------+--------------------+----+-------+
     | id | UserName | Attribute          | op | Value |
     +----+----------+--------------------+----+-------+
     | 1  | bartek   | Cleartext-Password | := | 1234  |
     +----+----------+--------------------+----+-------+

I would like it to return
     +----+----------+--------------------+----+-------+
     | id | UserName | Attribute          | op | Value |
     +----+----------+--------------------+----+-------+
     | 1  | bartek   | Cleartext-Password | := | 1234  |
     | 3  | bartek   | Simultaneous-Use   | := | 1     |
     +----+----------+--------------------+----+-------+

*But*, I would like to _hardcode_ the "Simultaneous-Use" row.
If I use a FUNCTION to build the "Cleartext-Password" row, it's because the data structure
could not have been feetched simply.

Is SELECTing INTO a second time OK?

--
       Architecte Informatique chez Blueline/Gulfsat:
    Administration Systeme, Recherche & Developpement
                                    +261 34 29 155 34

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Open source database design tool , alternative to MicroOLDAP
Next
From: Rakotomandimby Mihamina
Date:
Subject: Re: return multiple rows