Re: obtuse plpgsql function needs
От | elein |
---|---|
Тема | Re: obtuse plpgsql function needs |
Дата | |
Msg-id | 20030722163335.A18881@cookie обсуждение исходный текст |
Ответ на | obtuse plpgsql function needs (Robert Treat <xzilla@users.sourceforge.net>) |
Ответы |
Re: obtuse plpgsql function needs
|
Список | pgsql-sql |
You'll need to pass the values down to your concat function (which I suggest you don't call concat) and have it return a text type. What exactly is your problem? I must be missing something. elein On Tue, Jul 22, 2003 at 06:31:52PM -0400, Robert Treat wrote: > 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >
В списке pgsql-sql по дате отправления: