0

I am trying retrieve all tables and views created by a user using the following query:

SELECT table_name FROM information_schema.tables WHERE table_schema='public' 
and table_catalog='testdb' and (table_type='BASE TABLE' OR table_type='VIEW')
and table_name <> 'spatial_ref_sys'

The above query does return all tables and views but in case of a PostGIS database, there are additional views created automatically like the geometry_columns view. I don't want those views to be returned from the query. Even querying information_schema.views returns the same result.

I have a similar problem with tables as well where I'm suppressing the 'spatial_ref_sys' table but I'd like to do this in a more aesthetic way. Any suggestions?

Rahul Vijay Dawda
  • 1,123
  • 3
  • 14
  • 36
  • check [this](http://stackoverflow.com/q/24573428/3682599) – Vivek S. Jul 25 '14 at 06:19
  • 2
    I don't know if PostGIS supports this, but if you install it into its own schema, it would not clobber the `public` schema. –  Jul 25 '14 at 09:20

0 Answers0