Received: from viking.relc.com (viking.relc.com [193.124.229.195]) by hub.org (8.9.3/8.9.3) with SMTP id EAA20236 for ; Wed, 29 Sep 1999 04:14:16 -0400 (EDT) (envelope-from sbon@scelto.ts.kiev.ua) Received: from scelto.ts.kiev.ua by viking.relc.com with ESMTP id KAA08434; (8.8.8/zah/2.1) Wed, 29 Sep 1999 10:58:00 +0300 (EET DST) Received: from goth.ts.kiev.ua by scelto.ts.kiev.ua with ESMTP id KAA52994; (8.8.8/zah/2.1) Wed, 29 Sep 1999 10:56:09 +0300 (EEST) Message-ID: X-Mailer: XFMail 1.3 [p0] on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Wed, 29 Sep 1999 10:56:09 +0300 (EEST) Organization: Relcom-Ukraine Sender: sbon@goth.ts.kiev.ua From: Sergey Bondarenko To: pgsql-sql@postgresql.org Subject: plpgsql function arguments Hi! The documentation on PL/pgSQL reads: --cut name class%ROWTYPE; Declares a row with the structure of the given class. Class must be an existing table- or viewname of the database. The fields of the row are accessed in the dot notation. Parameters to a function can be composite types (complete table rows). In that case, the corresponding identifier $n will be a rowtype, but it must be aliased using the ALIAS command described below. Only the user attributes of a table row are accessible in the row, no Oid or other system attributes (hence the row could be from a view and view rows don't have useful system attributes). The fields of the rowtype inherit the tables fieldsizes or precision for char() etc. data types. ---cut Does someone used as arguments rowtypes? I failed even to create such function. I have a table called saldo. create table saldo ( usename text, saldo float8 ); Then I try to create a function: create function test ( ?????? ) reaturns int4 as ' declare x alias for $1; y saldo%rowtype; begin return 1; end; ' language 'plpgsql'; That's just test function. It does nothing. The question is what should I write instead of ?????? when I need to feed the function with the rowtype of saldo. I tried saldo%rowtype. It fails when meet '%'; Any advice greatly appreciated. Sergey Bondarenko Relcom-Ukraine system administrator