Skip to content

Ability to use SQL in "DB Restriction" field (like pgAdmin 3 did) (RM #4479) #2767

Closed
@dpage

Description

@dpage

Issue migrated from Redmine: https://redmine.postgresql.org/issues/4479
Originally created by John S at 2019-07-19 14:30:18 UTC.

Currently, if you wish to filter the databases shown when you connect to a server in pgAdmin 4, you must add every single database name to the "DB Restriction" field.

myprefix_database1 myprefix_database2 myprefix_database3 myprefix_database4 myprefix_database5 ...

This can be tedious especially if there are many databases, and if you frequently add and delete them for testing different things.

In pgAdmin 3, it was possible to use SQL in the "DB Restriction" field. This allowed you to apply filtering based on regexes or any kind of WHERE clause. For instance, you could enter this to show all databases whose names contained "myprefix_"

SELECT datname FROM pg_database
WHERE datistemplate = false AND datname ILIKE '%myprefix_%'
ORDER BY datname

This was extremely convenient. Not only was it shorter, but was dynamic and would automatically update your list if there were changes. It's a shame this feature was lost in the transition to pgAdmin 4.

Can it please be re-added?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions