Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id A1C9F475DCC for ; Thu, 4 Jul 2002 14:50:54 -0400 (EDT) Mailbox-Line: From sszabo@megazone23.bigpanda.com Thu Jul 4 14:50:54 2002 Received: from megazone.bigpanda.com (megazone.bigpanda.com [63.150.15.178]) by postgresql.org (Postfix) with ESMTP id 40F974767D6 for ; Thu, 4 Jul 2002 14:45:46 -0400 (EDT) Received: by megazone.bigpanda.com (Postfix, from userid 1001) id BC6F4D5F7; Thu, 4 Jul 2002 11:45:42 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by megazone.bigpanda.com (Postfix) with ESMTP id B23585C03; Thu, 4 Jul 2002 11:45:42 -0700 (PDT) Date: Thu, 4 Jul 2002 11:45:42 -0700 (PDT) From: Stephan Szabo To: Stephane Schildknecht Cc: Subject: Re: Boolean to int In-Reply-To: <1025803595.20819.239.camel@fukse> Message-ID: <20020704113843.C19207-100000@megazone23.bigpanda.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=-2.4 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,DOUBLE_CAPSWORD,NO_MX_FOR_FROM version=2.30 X-Spam-Level: X-Archive-Number: 200207/50 X-Sequence-Number: 8429 On 4 Jul 2002, Stephane Schildknecht wrote: > CREATE RULE boolean_return AS ON SELECT TO DOCUMENT DO INSTEAD > SELECT > document_id, > workflow_id, > type_document_id, > image_id, > theme_id, > document_version, > document_surtitre, > document_titre, > document_chapeau, > document_synthese, > document_corps, > document_pdf, > document_date_creation, > document_mot_clef, > (bool_to_int(document_online)) as document_online, > bool_to_int(document_valid) as document_valid FROM document; > > > psql:cnambo_proc_stock.sql:69: ERROR: select rule's target entry 15 > has different type from attribute document_online You might have better luck defining a view on Document that does it. Select rules are fairly limited except as the apply to making views work.