Skip to content

Use database comments to filter what we should show in lists #53

Open
@sastraxi

Description

@sastraxi

Currently, we accept a prefix option in the list command to make the output have a higher signal-to-noise when you have multiple projects' databases in your postgres instance.

Another approach is to use COMMENT ON [...] to automatically attach some psql-specific metadata in the database whenever we create databases, and filter to those databases that match the comment.

The proposal is to add something like this to .pgshrc:

{
  auto_comment: 'my_project_name',
}

This would enable both setting comments on creation / cloning and, by default, only showing those databases that match the comment (as well as the current database). We'd probably want to add an option to the list command to ignore all filters set in .pgshrc, as well as to filter to a different comment.

See https://stackoverflow.com/questions/11493978/how-to-retrieve-the-comment-of-a-postgresql-database

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions