Functions returning RECORD - Mailing list pgsql-general

From Thomas Hallgren
Subject Functions returning RECORD
Date
Msg-id 42676525.40408@mailblocks.com
Whole thread Raw
List pgsql-general
I have a question about syntax and feasibility.

I do the following:

CREATE FUNCTION xyz(int, int) RETURNS RECORD AS '...'
CREATE TABLE abc(a int, b int);

Now I want to call my xyz function once for each row in abc and I want
my RECORD to be (x int, y int, z timestamptz). How do I write that
query? I.e. where do specify my RECORD definition? Is it possible at
all? Ideally I'd like to write something like this:

SELECT xyz(a, b) AS (x int, y int, z timestamptz) FROM abc;

but that yields a syntax error.

Regards,
Thomas Hallgren


pgsql-general by date:

Previous
From: Daniel Schuchardt
Date:
Subject: Re: Windows install/uninstall as a "service"
Next
From: "Steve - DND"
Date:
Subject: Raise exception from regular SQL?