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 BBBA65292F for ; Fri, 12 Aug 2005 15:36:47 -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 17585-04 for ; Fri, 12 Aug 2005 18:36:46 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.202]) by svr1.postgresql.org (Postfix) with ESMTP id CF6D352936 for ; Fri, 12 Aug 2005 15:36:43 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 8so423232nzo for ; Fri, 12 Aug 2005 11:36:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pfqom9+MFuRw/eLIMhPfqFQWtKYOZfU3jOa2CjBqRoYNtfL2u6DsHV3hWNbYJZggse+hb7xeJjGObPAEVZsAPNSiLy75P6cjDukcs8sPUl3YPBea2nmEumh4hvDo7BieR+DwVleoWPGaPTjgG1K6c3S99unfcZrkGN/q7Rcoguw= Received: by 10.36.20.9 with SMTP id 9mr195970nzt; Fri, 12 Aug 2005 11:36:44 -0700 (PDT) Received: by 10.36.24.2 with HTTP; Fri, 12 Aug 2005 11:36:44 -0700 (PDT) Message-ID: <1d219a6f05081211364f77b99f@mail.gmail.com> Date: Fri, 12 Aug 2005 14:36:44 -0400 From: Chris Hoover To: pgsql-admin@postgresql.org Subject: Re: Help with function In-Reply-To: <1d219a6f05081210483f5402fe@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <1d219a6f05081210483f5402fe@mail.gmail.com> 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/155 X-Sequence-Number: 18474 Ok, here is a bit more information, When I declare the function as function(view_name, view_name) an try to update my view. I am getting the following errors: ERROR: record type has not been registered CONTEXT: PL/pgSQL function "clmhdr_view_update" while storing call arguments into local variables My rule is doing select function_name(new.*, old.*). =20 What is pg trying say here, and how to I modify my function to fix this? Thanks, Chris On 8/12/05, Chris Hoover wrote: > 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. >=20 > 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. >=20 > I tried to define the function as function_name(new_rec view_name, > old_rec view_name), but it abends on the call. >=20 > function_name(new_rec view_name%rowtype, old_rec view_name%rowtype) > will not compile. >=20 >=20 > Can someone please provide some guidance on how to pass the records to > my new function? >=20 > thanks, >=20 > Chris >