Problem whith table views. - Mailing list pgsql-general

From Nicolas Bouthors
Subject Problem whith table views.
Date
Msg-id 20020115113219.GB18452@lavardac.int.ghs
Whole thread Raw
Responses Re: Problem whith table views.  (Jan Wieck <janwieck@yahoo.com>)
List 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@bouthors.org -- http://nicolas.bouthors.org/ -- +33 6 2071 6234
Administateur Systèmes et Réseaux   --    GHS    --    38, Rue du Texel

pgsql-general by date:

Previous
From: Michael Meskes
Date:
Subject: Re:
Next
From: "Steve Boyle \(Roselink\)"
Date:
Subject: Re: SELECT help (fwd)