Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id AD069633D5F for ; Sat, 20 Feb 2010 11:47:24 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 88554-03-5 for ; Sat, 20 Feb 2010 15:47:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 426B6633C4D for ; Sat, 20 Feb 2010 11:47:08 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o1KFjVgT000943; Sat, 20 Feb 2010 10:45:31 -0500 (EST) To: Guy Deleeuw cc: pgsql-admin@postgresql.org Subject: Re: C trigger problem : conversion of CString to Datum In-reply-to: <4B7FFA2C.3030001@eurofer.be> References: <4B7FFA2C.3030001@eurofer.be> Comments: In-reply-to Guy Deleeuw message dated "Sat, 20 Feb 2010 16:05:16 +0100" Date: Sat, 20 Feb 2010 10:45:31 -0500 Message-ID: <942.1266680731@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.599 tagged_above=-10 required=5 tests=BAYES_00=-2.599 X-Spam-Level: X-Archive-Number: 201002/151 X-Sequence-Number: 33754 Guy Deleeuw writes: > I cannot convert properly a cstring to a Datum : Well, CStringGetDatum would be the proper thing to use if you meant to produce a Datum of type "cstring". But what you need here is a Datum of the same type as the target column, which evidently isn't cstring. Most likely you need to convert the string to type text. regards, tom lane