Update Postgresql example (#4642)

The query with pg_size_pretty returns the value as a string, that way you can’t have a nice chart or make value comparison. Inserted new query to return value as number.
This commit is contained in:
Nicholas Amadori 2018-02-12 08:46:34 +01:00 committed by Fabian Affolter
parent ddf522bb7b
commit 88d890aa46

View File

@ -90,6 +90,12 @@ SELECT * FROM states WHERE entity_id='binary_sensor.xyz789' GROUP BY state ORDER
### {% linkable_title Database size in Postgres %}
```sql
SELECT pg_size_pretty(pg_database_size('Database Name'));
```yaml
- platform: sql
db_url: postgresql://user:password@host/dbname
queries:
- name: db_size
query: "SELECT (pg_database_size('dsmrreader')/1024/1024) as db_size;"
column: "db_size"
unit_of_measurement: MB
```