[GENERAL] Not possible to compare regrole in a view query? - Mailing list pgsql-general

From Glen Huang
Subject [GENERAL] Not possible to compare regrole in a view query?
Date
Msg-id E919872C-26DB-4915-BB58-402C25F59A3E@gmail.com
Whole thread Raw
Responses Re: [GENERAL] Not possible to compare regrole in a view query?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I have this simple view definition:

CREATE TEMP VIEW user_schema AS
    SELECT nspname AS name FROM pg_namespace
    WHERE nspname = 'public' OR nspowner = ‘rolename'::regrole;

But it fails to create the view by complaining: constant of the type "regrole" cannot be used here

If I run the query directly, I get the correct result.

Does that mean I can’t compare role name this way in view? Should I use join to work around it?

Thanks.

pgsql-general by date:

Previous
From: Nico Williams
Date:
Subject: Re: [GENERAL] Create Action for psql when NOTIFY Recieved
Next
From: Milen Blagojevic
Date:
Subject: [GENERAL] CREATE TABLE LIKE including all not including storage parameters?