All sizes in MB, change /1024/1024 to /1024/1024/1024 for GB.
Without system databases
select
datname as database,
(pg_database_size(datname)/1024/1024) as size| if Rails.env.test? | |
| # inspired by Braintree's original WebhookTestingGateway, but with way more flexibility and complete data | |
| class BraintreeWebhookTestingGateway | |
| class << self | |
| def register_notification(identifier, kind = nil, &builder) | |
| @notifications ||= {} | |
| kind ||= identifier | |
| @notifications[identifier] = [kind, builder] | |
| end |
| /* | |
| * derivative work of Matheus de Oliveira's json_manipulator.sql | |
| * https://gist.github.com/matheusoliveira/9488951 | |
| * | |
| * adapted to support postgresql 9.4 jsonb type | |
| * no warranties or guarantees of any kind are implied or offered | |
| * | |
| * license is as Matheus conferred it on 4/9/2015: | |
| * matheusoliveira commented on Apr 9 | |
| * @hannes-landeholm, I'd like to take credit if you share them |