Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: add pg_database_size #26398

Open
BramGruneir opened this issue Jun 4, 2018 · 1 comment
Open

sql: add pg_database_size #26398

BramGruneir opened this issue Jun 4, 2018 · 1 comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)

Comments

@BramGruneir
Copy link
Member

BramGruneir commented Jun 4, 2018

PGAdmin issues the following query:

SELECT db.datname AS \"Database\", 
       numbackends AS \"Backends\", 
       xact_commit AS \"Xact committed\", 
       xact_rollback AS \"Xact rolled back\", 
       blks_read AS \"Blocks read\", 
       blks_hit AS \"Blocks hit\", 
       tup_returned AS \"Tuples returned\", 
       tup_fetched AS \"Tuples fetched\", 
       tup_inserted AS \"Tuples inserted\", 
       tup_updated AS \"Tuples updated\", 
       tup_deleted AS \"Tuples deleted\", 
       stats_reset AS \"Last statistics reset\", 
       slave.confl_tablespace AS \"Tablespace conflicts\", 
       slave.confl_lock AS \"Lock conflicts\", 
       slave.confl_snapshot AS \"Snapshot conflicts\", 
       slave.confl_bufferpin AS \"Bufferpin conflicts\", 
       slave.confl_deadlock AS \"Deadlock conflicts\", 
       temp_files AS \"Temporary files\", 
       temp_bytes AS \"Size of temporary files\", 
       deadlocks AS \"Deadlocks\", 
       blk_read_time AS \"Block read time\", 
       blk_write_time AS \"Block write time\", 
       pg_database_size(db.datid) AS \"Size\" 
FROM pg_stat_database AS db 
LEFT JOIN pg_stat_database_conflicts AS slave 
  ON db.datid = slave.datid 
WHERE db.datid > NULL::OID 
ORDER BY db.datname

Details here https://www.postgresql.org/docs/current/static/functions-admin.html

Jira issue: CRDB-5014

@BramGruneir BramGruneir added the A-sql-pgcompat Semantic compatibility with PostgreSQL label Jun 4, 2018
@BramGruneir BramGruneir added this to the 2.1 milestone Jun 4, 2018
@BramGruneir BramGruneir self-assigned this Jun 4, 2018
@knz knz mentioned this issue Jun 4, 2018
25 tasks
@knz knz added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Jun 5, 2018
@knz knz moved this from Triage to Backlog in (DEPRECATED) SQL Front-end, Lang & Semantics Jun 5, 2018
@knz knz moved this from Backlog to Candidate next milestone in (DEPRECATED) SQL Front-end, Lang & Semantics Jun 10, 2018
@knz knz moved this from Candidate next milestone to Backlog in (DEPRECATED) SQL Front-end, Lang & Semantics Jul 5, 2018
@knz knz modified the milestones: 2.1, 2.2 Aug 30, 2018
@petermattis petermattis removed this from the 2.2 milestone Oct 5, 2018
@asubiotto asubiotto moved this from Backlog to [TENT] SQL Features in [DEPRECATED] Old SQLExec board. Don't move stuff here Apr 2, 2020
@jordanlewis
Copy link
Member

This should be a straightforward extension of #59604.

@jordanlewis jordanlewis added this to Triage in SQL Sessions - Deprecated via automation Feb 1, 2021
@rafiss rafiss moved this from Triage to Longer term backlog in SQL Sessions - Deprecated Feb 23, 2021
@rafiss rafiss added the T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions) label May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql-pgcompat Semantic compatibility with PostgreSQL C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-sql-foundations SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Projects
No open projects
Development

No branches or pull requests

5 participants