pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Scott Marlowe <scott.marlowe@gmail.com>
To: Gregory Stark <stark@enterprisedb.com>
Cc: Michael Glaesemann <grzm@seespotcode.net>
Cc: Richard Broersma Jr <rabroersma@yahoo.com>
Cc: SQL Postgresql List <pgsql-sql@postgresql.org>
Subject: Re: SELECT syntax synopsis: column_definition?
Date: Tue, 21 Aug 2007 20:42:23 -0500
Message-ID: <dcc563d10708211842k365e15ccy631e4c43b98da996@mail.gmail.com> (raw)
In-Reply-To: <87zm0kigwe.fsf@oxford.xeocode.com>
References: <830878.14424.qm@web31803.mail.mud.yahoo.com>
	<50700110-2B0D-4935-B033-084ED908BEC5@seespotcode.net>
	<87zm0kigwe.fsf@oxford.xeocode.com>

On 8/21/07, Gregory Stark <stark@enterprisedb.com> wrote:
> "Michael Glaesemann" <grzm@seespotcode.net> writes:
>
> > ERROR:  a column definition list is only allowed for functions  returning
> > "record"
> >
> > So the *form* is right, but I don't know of an example that works.
>
> postgres=# create function testf() returns record as 'select 1' language sql;
> CREATE FUNCTION
> postgres=# select * from testf() as (i integer);
>  i
> ---
>  1
> (1 row)
>
>
> I haven't quite figured out how this is useful though. It probably makes more
> sense if you use plpgsql but I still don't quite see what the use case is.

I use them with the crosstab function in the tablefunc contrib module.



view thread (8+ messages)  latest in thread

Message-ID: <dcc563d10708211842k365e15ccy631e4c43b98da996@mail.gmail.com>
Permalink:  ../dcc563d10708211842k365e15ccy631e4c43b98da996@mail.gmail.com/
Also on:    postgresql.org/message-id/dcc563d10708211842k365e15ccy631e4c43b98da996@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: scott.marlowe@gmail.com, stark@enterprisedb.com, grzm@seespotcode.net, rabroersma@yahoo.com
  Subject: Re: SELECT syntax synopsis: column_definition?
  In-Reply-To: <dcc563d10708211842k365e15ccy631e4c43b98da996@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox