Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.2/8.9.1) with ESMTP id JAA18736 for ; Mon, 12 Apr 1999 09:20:51 -0400 (EDT) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id PAA08731; Mon, 12 Apr 1999 15:20:43 +0200 (MDT) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 2.05 #1 (Debian)) id 10WhV1-0006U8-00; Mon, 12 Apr 1999 14:15:43 +0000 Message-ID: <3711F2AF.9A92633F@sferacarta.com> Date: Mon, 12 Apr 1999 15:18:40 +0200 From: =?iso-8859-1?Q?Jos=E9?= Soares X-Mailer: Mozilla 4.5 [it] (Win95; I) X-Accept-Language: it MIME-Version: 1.0 To: Will Benton CC: pgsql-sql@postgresql.org Subject: Re: [SQL] aggregate functions and varchar type References: Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit The parser has some difficulties with "varchar" word. If you are using v6.4.? You can define your function as: create aggregate nlappend ( basetype = text, sfunc1 = nl_strappend, stype1 = text, initcond1 = '' ); and then define nl_strappend(text,text) and now you can pass varchar, char or text as paramters because PostgreSQL automatically converts it to text. José Will Benton ha scritto: > I am having trouble with the following aggregate function (in postgres > 6.4.2): > > create aggregate nlappend ( > basetype = varchar, > sfunc1 = nl_strappend, > stype1 = varchar, > initcond1 = '' > ); > > When I try to define it, I get "parse error at or near varchar". > (nl_strappend is a function of two varchar arguments that returns a > varchar). Defining an aggregate function on other types works fine. > > Is it possible to define an aggregate function on the varchar type? If > so, what am I doing wrong? > > Please reply via private email; I will summarize replies and followup to > the list. > > thanks, > wb > > --- > Will Benton | "A black eye never reformed a drunkard; a czar never > bentonw@stolaf.edu | stopped a free thought" --Charles Ives