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?

2
  • check this Commented Jul 25, 2014 at 6: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. Commented Jul 25, 2014 at 9:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.