pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Robert Treat <xzilla@users.sourceforge.net>
To: pgsql-sql@postgresql.org
Subject: obtuse plpgsql function needs
Date: 22 Jul 2003 18:31:52 -0400
Message-ID: <1058913112.22259.271.camel@camel> (raw)

given 

create table t1 (f,f1,f2,f3);
create table t2 (f,f4,f5,f6);

i'm trying to create a function concat() that does something like:

select f,concat() as info from t1;

which returns a result set equivalent to:
select f,('f1:' || f1 || '- f2:' || f2 || '- f3:' || f3) as x from t1;

or
select f,concat() as info from t2;
returns equivalent

select f,('f4:' || f4 || ' - f5:' || f5 || ' - f6:' || f6) as x from t2;


I'm starting to believe this is not possible, has anyone already done
it? :-)

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL




view thread (14+ messages)  latest in thread

Message-ID: <1058913112.22259.271.camel@camel>
Permalink:  ../1058913112.22259.271.camel@camel/
Also on:    postgresql.org/message-id/1058913112.22259.271.camel@camel

 · 

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: xzilla@users.sourceforge.net
  Subject: Re: obtuse plpgsql function needs
  In-Reply-To: <1058913112.22259.271.camel@camel>

* 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