Commands
  • About
  • Software Development
    • Glossary
    • System Design
      • CAP Theorem
      • Data Migration
      • EAV Model
      • ETL Process
      • Event Sourcing
      • Outbox Pattern
      • SOLID Principles
    • Standards
      • Character Encoding
      • Twirp
    • Elixir
      • IEx
      • Mix
      • Libraries
      • Code Snippets
    • Node.js
      • TypeScript
  • Commands
    • Bookmarks
    • AWS
      • Athena
      • ECS
    • Docker
      • Manage Images
      • Manage Containers
    • File System
      • Grep
      • Search Files
      • Miscellaneous
    • Git
      • Setup New Project
      • Manage Remotes
      • Release Project
    • GPG
    • Kafka
      • Quick Start
    • Kubernetes
    • OpenShift
      • Manage Roles and Bindings
    • PostgreSQL
    • SSL / TLS
      • Common OpenSSL Commands
      • Create Self-signed Certificate
      • Java Truststore and Keystore
    • SSH
      • Key Management
      • Port Forwarding
    • YUM
      • List Repositories
      • List Packages
    • Miscellaneous
      • Network
Powered by GitBook
On this page
  • Turn On the Expanded Table Formatting Mode
  • Describe Table Structure
  • Estimate the Total Number of Rows
  • Check Query State
  1. Commands

PostgreSQL

Turn On the Expanded Table Formatting Mode

\x

Describe Table Structure

\d+ <SCHEMA_NAME>.<TABLE_NAME>

Estimate the Total Number of Rows

SELECT schemaname, relname, n_live_tup FROM pg_stat_all_tables WHERE relname='<TABLE_NAME>';

Check Query State

SELECT state, query FROM pg_stat_activity WHERE query LIKE '<QUERY_PATTERN>';
PreviousManage Roles and BindingsNextSSL / TLS

Last updated 3 years ago