You can use the below command to rename an existing sequence where seq_name is the current name of the sequence
Continue readingPostgreSQL – Move Sequence to a different Schema
You can use the below sql statement to move sequence to a different schema. Here seq_name is the name of
Continue readingPostgreSQL – Rename Tablespace
Below is the syntax to rename a tablespace in Postgresql database where tablespace_name is the current name of the tablespace
Continue readingPostgreSQL – Change Owner of Tablespace
You can change the owner of a Tablespace as shown below in Postgres database where tablespace_name is the name of
Continue readingPostgreSQL – Identify tables used by a View
You can query the system catalog view view_table_usage to identify all the tables used by a view in Postgres database.
Continue readingPostgreSQL – List all Schemas
You can query the system catalog table pg_namespace to view all the schemas in Postgres database. SELECT nspname, oid from
Continue readingPostgreSQL – View all columns of a table
You can query the system catalog table ‘columns’ to view all the columns of a table and their data types
Continue readingPostgreSQL – List all views
You can query the system catalog table ‘views’ to list all the views of a postgres database as shown below:
Continue readingPostgreSQL – Drop Table
Syntax to drop a table in Postgres: DROP TABLE tablename; Syntax to drop multiple tables in Postgres: DROP TABLE tablename1,
Continue readingPostgreSQL – Get ddl of a view
You can query the system catalog table ‘views’ to get the definition of a view in postgres database. SELECT view_definition
Continue reading