Skip to content

AWS bytes

  • Cheat Sheets
  • Concepts
    • Show All
    • S3 Concepts
  • How-To Guides
    • Show all
    • EC2
    • EBS
    • S3
    • Redshift
    • IAM
    • SQS
    • CloudWatch
    • Billing
  • CLI Guides
  • Contact Us
  • Tutorials
  • Interview Questions
  • Postgresql

Category: Postgresql

Postgresql

PostgreSQL – Get definition of a materialized view

You can query the pg_matviews system catalog view to get ddl of a materialized view in Postgres database. SELECT definition

Continue reading
Postgresql

PostgreSQL – List materialized views

You can query the system catalog view pg_matviews to view all the materialized views. SELECT schemaname, matviewowner, matviewname from pg_matviews;

Continue reading
Postgresql

PostgreSQL – Get table size

pg_relation_size() function can be used to obtain the size of a table in bytes in Postgres database. Below is the

Continue reading
Postgresql

PostgreSQL – Get database size

Run the below query to get the size of a Postgres database, where ‘your_database_name’ is the name of the database

Continue reading
Postgresql

PostgreSQL – Kill user session

Identify the session that you would like to terminate from the below view and copy the pid. SELECT * FROM

Continue reading
Postgresql

PostgreSQL – Aggregate Functions

Aggregate functions are functions that are computed over a set of rows to return an output. Average, Max, Min, Sum

Continue reading
Postgresql

PostgreSQL – How to limit the number of rows returned by a query

Postgres supports ‘LIMIT’ clause to return only a certain number of rows by a query. Syntax: SELECT * from table1

Continue reading
Postgresql

PostgreSQL – LIKE operator

LIKE operator is used to find strings with matching pattern. ‘%’ is used to match any number of characters and

Continue reading
Postgresql

PostgreSQL – EXCEPT operator

Postgres EXCEPT operator is used to compare the result sets of 2 queries . It returns rows from first query

Continue reading
Postgresql

PostgreSQL – Composite Primary Key

In Relational databases, a primary key is a column(or multiple columns) that is used to uniquely identify rows of a

Continue reading

Posts pagination

«Previous Posts 1 … 6 7 8 9 10 Next Posts»
  • PostgreSQL Tutorials
  • Redshift Tutorials
WordPress Theme: Maxwell by ThemeZee.