Re: Me And My Database - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Me And My Database
Date
Msg-id 20060614090901.GC4748@svana.org
Whole thread Raw
In response to Re: Me And My Database  ("Leif B. Kristensen" <leif@solumslekt.org>)
Responses Re: Me And My Database
List pgsql-general
On Wed, Jun 14, 2006 at 11:04:19AM +0200, Leif B. Kristensen wrote:
> One question: When I have a function like this:
>
> CREATE OR REPLACE FUNCTION get_source_text(INTEGER) RETURNS TEXT AS $$
> DECLARE
>     src sources%ROWTYPE;

<snip>

> What do you suggest that I write instead of "SELECT * FROM sources INTO
> src", when src is defined as sources%ROWTYPE? The table sources is
> defined as:

IIRC, if you just declare src as type "record" you can select any
fields you like. AIUI, declaring a row to be of a specific type is only
really important if you plan to return it or pass it to another
function.

Have a ncie day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: "Leif B. Kristensen"
Date:
Subject: Re: Me And My Database
Next
From: "Leif B. Kristensen"
Date:
Subject: Re: Me And My Database