From: | Neil Anderson <neil(at)postgrescompare(dot)com> |
---|---|
To: | Melvin Davidson <melvin6925(at)gmail(dot)com> |
Cc: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Help with terminology to describe what my software does please? |
Date: | 2017-05-28 19:11:10 |
Message-ID: | CAEKCySsmCODecv_6R=Bi-WWgdx-+awoNMGVMD=uMRqATDO7dMw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>
>
> Cluster comparison would only occur if you have two or more clusters on
> the same server, although it's possible to compare across servers,
> but that would involve a lot more work. AFAIK, the only differences for a
> cluster would be:
> 1. PostgreSQL version
> 2. path to database
> 3. database users (note: it is also possible to make users database
> specific)
> 4. list of defined databases
>
I was considering configuration settings to be at the cluster level too.
Stuff from pg_settings or pg_config. Also I think tablespaces are at that
level too. What do you think?
> Database comparison would involve db names, owners, encodings, tablespaces
> and acl's
> You might also want to include sizes. You can use the following two
> queries to help
> with that
>
> SELECT db.datname,
> au.rolname as datdba,
> pg_encoding_to_char(db.encoding) as encoding,
> db.datallowconn,
> db.datconnlimit,
> db.datfrozenxid,
> tb.spcname as tblspc,
> db.datacl
> FROM pg_database db
> JOIN pg_authid au ON au.oid = db.datdba
> JOIN pg_tablespace tb ON tb.oid = db.dattablespace
> ORDER BY 1;
>
> SELECT datname,
> pg_size_pretty(pg_database_size(datname))as size_pretty,
> pg_database_size(datname) as size,
> (SELECT pg_size_pretty (SUM( pg_database_size(datname))::bigint)
> FROM pg_database) AS total,
> ((pg_database_size(datname) / (SELECT SUM(
> pg_database_size(datname))
> FROM pg_database) ) *
> 100)::numeric(6,3) AS pct
> FROM pg_database
> ORDER BY datname;
>
That's a great idea! Thanks for the info.
>
>
>
> --
> *Melvin Davidson*
> I reserve the right to fantasize. Whether or not you
> wish to share my fantasy is entirely up to you.
>
--
Neil Anderson
neil(at)postgrescompare(dot)com
https://www.postgrescompare.com
From | Date | Subject | |
---|---|---|---|
Next Message | Neil Anderson | 2017-05-28 19:13:36 | Re: Help with terminology to describe what my software does please? |
Previous Message | Michelle Konzack | 2017-05-28 18:55:37 | Re: SELECT statement with sub-queries |