Re: Distinguish view and table problem - Mailing list pgsql-hackers

From Filip Rembiałkowski
Subject Re: Distinguish view and table problem
Date
Msg-id 92869e660912180847j2a237962sc1163e123c1be78@mail.gmail.com
Whole thread Raw
In response to Distinguish view and table problem  ("suzhiyang" <suzhiyang@gmail.com>)
List pgsql-hackers

2009/12/18 suzhiyang <suzhiyang@gmail.com>
How could I get the relkind of a table(view) by its name from pg_class?

pg_class is (quite logically) UNIQUE on (relname, relnamespace)

SELECT c.relkind from pg_class c, pg_namespace n
where c.relnamespace = n.oid
and c.relname = 'thetable'
and n.nspname = 'theschema'



--
Filip Rembiałkowski
JID,mailto:filip.rembialkowski@gmail.com
http://filip.rembialkowski.net/

pgsql-hackers by date:

Previous
From: "suzhiyang"
Date:
Subject: Distinguish view and table problem
Next
From: Robert Haas
Date:
Subject: Re: PATCH: Add hstore_to_json()