X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 910FA52EC2 for ; Fri, 12 Aug 2005 14:48:19 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 62613-02 for ; Fri, 12 Aug 2005 17:48:14 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by svr1.postgresql.org (Postfix) with ESMTP id 854A252EBF for ; Fri, 12 Aug 2005 14:48:13 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 8so417558nzo for ; Fri, 12 Aug 2005 10:48:14 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=MJR7NCiFtKAktctygTybAPedtxfGsVJagm2BL18IayjxMZVjVI/lRbVtto/f7rIJAFGdwXhTZUWY3kvmFhbg4HpSd4hkHJ6TyTFbGRqTCENT88JSHnAt2XX7/dyRkfTA9vIT2SZyU4ADw8kKSOGpq94yMQm74jkp9TpKFkNRAVY= Received: by 10.36.250.19 with SMTP id x19mr2593431nzh; Fri, 12 Aug 2005 10:48:13 -0700 (PDT) Received: by 10.36.24.2 with HTTP; Fri, 12 Aug 2005 10:48:13 -0700 (PDT) Message-ID: <1d219a6f05081210483f5402fe@mail.gmail.com> Date: Fri, 12 Aug 2005 13:48:13 -0400 From: Chris Hoover To: pgsql-admin@postgresql.org Subject: Help with function Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.024 tagged_above=0 required=5 tests=[RCVD_BY_IP=0.024] X-Spam-Level: X-Archive-Number: 200508/154 X-Sequence-Number: 18473 I need some help with how to define a function. I am trying to create a function that I pass two records into. However, I can not seem to get the syntax correct in the definition. Exactly what I'm doing is having a rule on one of my views call a function and pass the new.* and old.* records to the function. the function will then handle the inserting, updating, and deleting from the underlying tables. I tried to define the function as function_name(new_rec view_name, old_rec view_name), but it abends on the call. function_name(new_rec view_name%rowtype, old_rec view_name%rowtype) will not compile. Can someone please provide some guidance on how to pass the records to my new function? thanks, Chris