How to get text representation of composite value?

From: "David Flegl" <ml_flegl(at)centrum(dot)cz>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: How to get text representation of composite value?
Date: 2007-04-24 12:12:38
Message-ID: 200704241412.8228@centrum.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello,
I'd like to ask you for a help. I'm in trouble with $subj. I need something like documentation of PostgreSQL in chapter 8.11.5 says.
Inside trigger I have record type NEW which is composite type. How could one do something like :

text_var:=to_char(NEW)

So if NEW.at1='test' and NEW.at2=100 I would get string: 'test',100

But the problem is then if trigger is generally used for many tables, I
don't know number of elements and so on.

As I know, for element types are defined output function, and I can use this:
SELECT textin(point_out('(1,1)'::point))::varchar;

Anybody can help me?
P.S. pl/pgsql would be best way if it possible.

David F

Browse pgsql-sql by date

  From Date Subject
Next Message Dmitry Turin 2007-04-24 12:31:33 Re: We all are looped on Internet: request + transport = invariant
Previous Message Penchalaiah P. 2007-04-24 12:09:05 hi