Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id A7A439FB67F for ; Tue, 24 Apr 2007 09:12:49 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 29350-05 for ; Tue, 24 Apr 2007 09:12:40 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail1002.centrum.cz (mail1002.centrum.cz [213.29.7.174]) by postgresql.org (Postfix) with ESMTP id 2E0AD9FB4D2 for ; Tue, 24 Apr 2007 09:12:44 -0300 (ADT) Received: by mail1002.centrum.cz id S53446149AbXDXMMi (ORCPT ); Tue, 24 Apr 2007 14:12:38 +0200 Received: from 85.160.69.40 by mail1002.centrum.cz (Centrum Mail) with HTTP Date: Tue, 24 Apr 2007 14:12:38 +0200 From: "David Flegl" To: X-Mailer: Centrum Mail 1.0 MIME-Version: 1.0 X-Priority: 3 Message-ID: <200704241412.8228@centrum.cz> Subject: How to get text representation of composite value? Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/224 X-Sequence-Number: 28224 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