Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f16D8ux74754 for ; Tue, 6 Feb 2001 08:08:56 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from mailsys01.intnet.net (tmail.wwc.com [198.252.32.143] (may be forged)) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f15IhBx51434 for ; Mon, 5 Feb 2001 13:43:12 -0500 (EST) (envelope-from joe.conway@mail.com) Received: from [134.24.34.227] (HELO jecw2k1) by mailsys01.intnet.net (CommuniGate Pro SMTP 3.3.2) with SMTP id 3337974; Mon, 05 Feb 2001 13:42:43 -0500 Message-ID: <00c301c08fa3$6edc0c90$c4d210ac@jecw2k1> Reply-To: "Joe Conway" From: "Joe Conway" To: , References: <01C08F4D.A9B6D800.mdavis@sevainc.com> Subject: Re: RE: C function for use from PLpgSQL trigger Date: Mon, 5 Feb 2001 10:42:45 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Archive-Number: 200102/76 X-Sequence-Number: 1252 > You could send the column name directly into your c function. For example: > c_function_name(NEW.col1, NEW.col2, NEW.col3). Otherwise I am not sure how > to send NEW into a C function. You could try declaring NEW in your C > function as a tuple. Thanks for your reply. I was hoping that I could avoid hardcoding NEW.col1, etc, so that the function could be used for multiple relations. I've also tried to declare the input parameter to the function as a tuple, but PLpgSQL never gets that far -- it doesn't seem to support passing NEW as a parameter. Oh, well. I will probably just write all of my logic into a C function and skip PLpgSQL entirely. That's too bad because it would be far simpler (and preferrable IMHO) to write a generic trigger function in PLpgSQL and call C functions for only certain operations that PLpgSQL does not directly support. Joe