How to get postgresql list views?

347    Asked by AndreaBailey in SQL Server , Asked on Sep 30, 2022

How do I list all views for a database using an SQL command in PostgreSQL? I would like something similar to output of the psql dv command, but preferably just a list of view names. e.g.,

SELECT ...;
my_view_1
my_view_2
my_view_3

I'm running PostgreSQL v9.1.4 on Ubuntu Linux.

Answered by Amit Sinha

If you only need this interactively while in psql, you can also use dv to show postgresql list views, or dm for materialised views. Or use with +, like dm+ for example to show some additional information (mostly useful to see materialised view size).


Your Answer

Interviews

Parent Categories