Option to show system catalog but hide temp and toast schemas #12

Closed
qwesda opened this Issue Jun 19, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@qwesda

qwesda commented Jun 19, 2015

While the information_schema and pg_catalog schemas are often useful pg_toast, pg_temp_\d+, pg_toast_temp_\d+ usually aren't.

The option in the preferences should have these settings:

  • show only user schemas
  • show user schemas and pg_catalog, information_schema
  • show all schemas

If all schemas are shown then information_schema should be sorted after the user tables (which it is) but before pg_catalog, currently information_schema is always the last entry.

The schemas should also be sorted with natural sort, right now the order is pg_temp_1, pg_temp_10, ... pg_temp_19, pg_temp_2, pg_temp_21, ...

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Jun 19, 2015

Owner

I'm already working on this.

  1. I changed the sort order to "natural" instead of alphabetical (pg_temp_1, pg_temp_2, etc.)
  2. pg_toast* schemas are now hidden (but can be shown using a hidden preference)
  3. Only the pg_temp schema for the current connection is shown (if you created any temp objects). temp schemas from other connections are hidden (this only works on 8.2 and later; earlier versions have no way to determine who a temp schema belongs to. Unfortunately Redshift is based on 8.0)
  4. there's a preference to show system schemas (pg_catalog, information_schema)

You can download a nightly build here.

Owner

jakob commented Jun 19, 2015

I'm already working on this.

  1. I changed the sort order to "natural" instead of alphabetical (pg_temp_1, pg_temp_2, etc.)
  2. pg_toast* schemas are now hidden (but can be shown using a hidden preference)
  3. Only the pg_temp schema for the current connection is shown (if you created any temp objects). temp schemas from other connections are hidden (this only works on 8.2 and later; earlier versions have no way to determine who a temp schema belongs to. Unfortunately Redshift is based on 8.0)
  4. there's a preference to show system schemas (pg_catalog, information_schema)

You can download a nightly build here.

@jakob jakob added the enhancement label Jun 19, 2015

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Jun 19, 2015

nice!

what is your support plan for older postgres versions anyway? 8.x reached end-of-life in 2014 ...

qwesda commented Jun 19, 2015

nice!

what is your support plan for older postgres versions anyway? 8.x reached end-of-life in 2014 ...

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Jun 19, 2015

Owner

I try to support PostgreSQL 8.0 and above. I need to stay compatible with 8.0 because of Amazon Redshift, which is pretty popular.

It doesn't cost a lot to stay backward compatible, since libpq is backward compatible anyway, even with unsupported versions. I just need to make sure to not use modern functions on older server versions (like in this case, call pg_my_temp_schema() only on 8.2 and later). Fortunately the PostgreSQL docs are pretty thorough and make that easy.

Owner

jakob commented Jun 19, 2015

I try to support PostgreSQL 8.0 and above. I need to stay compatible with 8.0 because of Amazon Redshift, which is pretty popular.

It doesn't cost a lot to stay backward compatible, since libpq is backward compatible anyway, even with unsupported versions. I just need to make sure to not use modern functions on older server versions (like in this case, call pg_my_temp_schema() only on 8.2 and later). Fortunately the PostgreSQL docs are pretty thorough and make that easy.

@jakob jakob closed this Jun 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment