pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: Stephane Schildknecht <sschildknecht@aurora-linux.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Boolean to int
Date: Thu, 4 Jul 2002 11:45:42 -0700 (PDT)
Message-ID: <20020704113843.C19207-100000@megazone23.bigpanda.com> (raw)
In-Reply-To: <1025803595.20819.239.camel@fukse>


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.







view thread (5+ messages)  latest in thread

Message-ID: <20020704113843.C19207-100000@megazone23.bigpanda.com>
Permalink:  ../20020704113843.C19207-100000@megazone23.bigpanda.com/
Also on:    postgresql.org/message-id/20020704113843.C19207-100000@megazone23.bigpanda.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sszabo@megazone23.bigpanda.com, sschildknecht@aurora-linux.com
  Subject: Re: Boolean to int
  In-Reply-To: <20020704113843.C19207-100000@megazone23.bigpanda.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox