pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Klemme <mklemme@gmx.de>
To: pgsql-sql@postgresql.org
Cc: Christoph Konnertz <christoph@inm.de>
Subject: SQL Problem: ERROR:  ExecEvalExpr: unknown expression type 108
Date: Fri, 4 Jun 1999 14:14:49 +0200
Message-ID: <19990604141449.A573@moa.rhein-main.de> (raw)

Hallo!

I try to create a web server authentification database for our Apache
using PostgreSQL.
Students will be added to certain groups, group entries need to be
invalidated once in a while.



    klemme@moa:~/Postgres/auth> psql -d authentify -f auth-create-test.sql

    DROP TABLE user;
    DROP
    DROP TABLE ugroup;
    DROP
    -- user entries
    CREATE TABLE user(
    vorname         char(20) NOT NULL,      --Vorname des Benutzers
    name            char(20) NOT NULL,      --Name des Benutzers
    uname	    char(10) PRIMARY KEY,  --eindeutiger Benutzername des Benutzers im Server';
    pass            char(16) NOT NULL,      --Paßwort des Benutzers
    changed         date NOT NULL
    );
    NOTICE:  CREATE TABLE/PRIMARY KEY will create implicit index user_pkey for table userCREATE

    -- group entries
    CREATE TABLE ugroup
    (
    uname           char(10) NOT NULL,      --Zeiger auf user
    ugroup          char(10) NOT NULL,      --Name der Gruppe
    expires         date NOT NULL,          --Verfallsdatum
    changed         date NOT NULL);
    CREATE

    CREATE UNIQUE INDEX ugroup_idx ON ugroup (uname,ugroup);
    CREATE

    vacuum;
    VACUUM

    --- Test entries

    insert into user values ('Michael', 'Klemme', 'mklemme', 'xxxx', '04-06-1999');
    INSERT 24895 1
    insert into user values ('Michaela','Klemme','maklemme', 'xxxx', '04-06-1999');
    INSERT 24896 1

    insert into ugroup values ('mklemme', 'Physics', '31-12-1999',  '04-06-1999');
    INSERT 24897 1
    insert into ugroup values ('mklemme', 'Math', '31-12-1999',  '04-06-1999');
    INSERT 24898 1
    insert into ugroup values ('maklemme', 'Math', '31-12-1998', '04-06-1999');
    INSERT 24899 1


    --I need to create a view for the Apache module that only returns user
    --entries if a non-expired group entry exists.
    --The SELECT Statement below works okay.

    SELECT uname, pass FROM user
    WHERE UNAME IN
    (SELECT uname FROM ugroup WHERE expires >=  datetime_date('now'));
    uname     |pass            
    ----------+----------------
    mklemme   |xxxx            
    (1 row)


    --However, if I use the same statment in a view, I get this error message

    -- view to be accessed by Apache
    DROP VIEW legal_user;
    DROP
    CREATE VIEW legal_user AS
    SELECT uname, pass FROM user
    WHERE UNAME IN
    (SELECT uname FROM ugroup WHERE expires >=  datetime_date('now'));
    CREATE

    SELECT * FROM legal_user;
    ERROR:  ExecEvalExpr: unknown expression type 108
    EOF

ANy help would be greatly appreciated!

Thanks, 
Grüße
        Michael
--
Michael Klemme
@home            mklemme@gmx.de / 
                 klemme@bankakademie.de / klemme@acm.org
                 PGP: http://www.hmu.auckland.ac.nz/~michael-k/pgp

Attachments:

auth-create-test.sql (text/plain, 1.6K) download DROP TABLE user; DROP TABLE ugroup; -- user entries CREATE TABLE user ( vorname char(20) NOT NULL, --Vorname des Benutzers name char(20) NOT NULL, --Name des Benutzers uname char(10) PRIMARY KEY, --eindeutiger Benutzername des Benutzers im Server'; pass char(16) NOT NULL, --Paßwort des Benutzers changed date NOT NULL ); -- group entries CREATE TABLE ugroup ( uname char(10) NOT NULL, --Zeiger auf user ugroup char(10) NOT NULL, --Name der Gruppe expires date NOT NULL, --Verfallsdatum changed date NOT NULL ); CREATE UNIQUE INDEX ugroup_idx ON ugroup (uname,ugroup); vacuum; --- Test entries insert into user values ('Michael', 'Klemme', 'mklemme', 'xxxx', '04-06-1999'); insert into user values ('Michaela','Klemme','maklemme', 'xxxx', '04-06-1999'); insert into ugroup values ('mklemme', 'Physics', '31-12-1999', '04-06-1999'); insert into ugroup values ('mklemme', 'Math', '31-12-1999', '04-06-1999'); insert into ugroup values ('maklemme', 'Math', '31-12-1998', '04-06-1999'); --I need to create a view for the Apache module that only returns user --entries if a non-expired group entry exists. --The SELECT Statement below works okay. SELECT uname, pass FROM user WHERE UNAME IN (SELECT uname FROM ugroup WHERE expires >= datetime_date('now')); --However, if I use the same statment in a view, I get this error message -- view to be accessed by Apache DROP VIEW legal_user; CREATE VIEW legal_user AS SELECT uname, pass FROM user WHERE UNAME IN (SELECT uname FROM ugroup WHERE expires >= datetime_date('now')); SELECT * FROM legal_user;

view thread (3+ messages)  latest in thread

Message-ID: <19990604141449.A573@moa.rhein-main.de>
Permalink:  ../19990604141449.A573@moa.rhein-main.de/
Also on:    postgresql.org/message-id/19990604141449.A573@moa.rhein-main.de

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: mklemme@gmx.de, christoph@inm.de
  Subject: Re: SQL Problem: ERROR:  ExecEvalExpr: unknown expression type 108
  In-Reply-To: <19990604141449.A573@moa.rhein-main.de>
  References: <19990604141449.A573@moa.rhein-main.de>

* 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