Received: from mail1.hub.org (webmail.hub.org [216.126.85.1]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8JMDde95444 for ; Wed, 19 Sep 2001 18:13:39 -0400 (EDT) (envelope-from kb136@hszk.bme.hu) Received: from ural2.hszk.bme.hu (ural2.hszk.bme.hu [152.66.130.2]) by mail1.hub.org (8.11.3/8.11.4) with ESMTP id f8JM41D92763 for ; Wed, 19 Sep 2001 18:04:09 -0400 (EDT) (envelope-from kb136@hszk.bme.hu) Received: (from kb136@localhost) by ural2.hszk.bme.hu (8.11.3/8.11.3) id f8JM3pk18717; Thu, 20 Sep 2001 00:03:51 +0200 (MEST) Date: Thu, 20 Sep 2001 00:03:51 +0200 (MEST) From: Kovacs Baldvin X-X-Sender: To: Jeff Eckermann cc: =?iso-8859-1?Q?Miguel_Gonz=E1lez?= , PostgreSQL SQL Subject: Re: Creating a boolean function In-Reply-To: <01a001c14144$ebd04100$279c10ac@INTERNAL> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200109/160 X-Sequence-Number: 4841 > You need conditional logic, which suggests pl/pgsql is the way to go. Maybe he could use simple sql function like this: create function check_loan(text,int,int) returns boolean as ' select ( select count(*) from kolcsonok where code_user=($2) and code_loan=($3) and typetable=($1) ) > 0; ' language 'sql'; The immediate benefit of it is that there's no need to install a procedural languge for this simple task. Regards, Baldvin