Re: Boolean to int

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Stephane Schildknecht <sschildknecht(at)aurora-linux(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Boolean to int
Date: 2002-07-04 18:45:42
Message-ID: 20020704113843.C19207-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message teknokrat 2002-07-04 21:05:58 Re: Can this be done with sql?
Previous Message Stephane Schildknecht 2002-07-04 17:26:35 Boolean to int