Problem whith table views.

From: Nicolas Bouthors <nbouthors(at)ghs(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Cc: sbourgeois(at)ghs(dot)fr
Subject: Problem whith table views.
Date: 2002-01-15 11:32:20
Message-ID: 20020115113219.GB18452@lavardac.int.ghs
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

We have a problem here : we crate 2 tables, and for each of them there is a
view for selecting (almost) all fields of the table. Both tables are
owned by "dba", and noone else has rights on them.

Both views are GRANTed select to group 'mygroup' (which is used by
apache to get the data).

But when apache tries to SELECT from one view it works fine, but on the
other one it fails.

Any ideas ?

------------------------------ Definitions of tables and views follow -----------------------------------------

First table is :
CREATE TABLE tbl_schema (
cle_schema Serial,
code_tbl varchar(20) NOT NULL,
code_schema varchar(20) UNIQUE NOT NULL,
lib_schema varchar(64) NOT NULL,
descr text,
cle_wf_etat int4 NOT NULL,
date_creation datetime DEFAULT TEXT 'now' NOT NULL,
date_maj datetime DEFAULT TEXT 'now' NOT NULL,
version int4 NOT NULL,
PRIMARY KEY (cle_schema),
FOREIGN KEY (cle_wf_etat) REFERENCES tbl_wf_etat(cle_wf_etat)
);

With this view :
CREATE VIEW vue_schema AS
SELECT code_schema, lib_schema
FROM tbl_schema;
GRANT SELECT ON vue_schema TO GROUP ghs;

Second table is :
CREATE TABLE tbl_type_doc (
cle_type_doc Serial,
code_type_doc varchar(20) NOT NULL UNIQUE,
lib_type_doc varchar(64),
descr text,
is_dossier bool DEFAULT 'f' NOT NULL,
date_creation datetime DEFAULT TEXT 'now' NOT NULL,
date_maj datetime DEFAULT TEXT 'now' NOT NULL,
version int4 NOT NULL,
PRIMARY KEY (cle_type_doc)
);

With this view :
CREATE VIEW vue_type_doc AS
SELECT cle_type_doc, code_type_doc, lib_type_doc, descr, is_dossier
FROM tbl_type_doc;

GRANT SELECT ON vue_type_doc TO GROUP ghs;

--
nicolas(at)bouthors(dot)org -- http://nicolas.bouthors.org/ -- +33 6 2071 6234
Administateur Systèmes et Réseaux -- GHS -- 38, Rue du Texel

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Boyle (Roselink) 2002-01-15 11:49:24 Re: SELECT help (fwd)
Previous Message Michael Meskes 2002-01-15 10:29:33 Re: