pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feedBasic Questions about PostgreSQL.
6+ messages / 6 participants
[nested] [flat]
* Basic Questions about PostgreSQL.
@ 2021-09-15 05:10 A Z <poweruserm@live.com.au>
2021-09-15 05:32 ` Re: Basic Questions about PostgreSQL. David G. Johnston <david.g.johnston@gmail.com>
2021-09-15 08:38 ` Re: Basic Questions about PostgreSQL. rob stone <floriparob@gmail.com>
2021-09-15 13:19 ` Re: Basic Questions about PostgreSQL. Simon Riggs <simon.riggs@enterprisedb.com>
2021-09-15 14:25 ` Re: Basic Questions about PostgreSQL. Adrian Klaver <adrian.klaver@aklaver.com>
0 siblings, 4 replies; 6+ messages in thread
From: A Z @ 2021-09-15 05:10 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
-In PostgreSQL, what is the difference between Roles, Groups, and Policies exactly? What are they each, how do they relate to one another, and which one(s) can be assigned to another?
-Is there a simple, immediate, straightforward way to temporarily disable PostgreSQL database
use of all other users, except development users, or in fact just one user (one developer, yourself)
so that maintenance on the data or the data model may be performed?
The way things are, after you revoke connection priviledges for all the other general users,
cancel all the other connections (except for yourself, or developer user access),
and then perform required maintenance on the database. Thereafter, connection priviledges
have to be restored to all the other users, so that they can choose to connect again.
All of this strikes me as being very elaborate. Is there a much more simple
way to disable all and subsequent connections to a database, temporarily, and
then allowing them all again, within the PostgreSQL DBMS?
Is there a public Extension, for example, that installs and works well, which can be used to do this?
Is there a simple, one hit way to turn a set of user connections all off, and then all on
(regarding their permissions and connections, I presume), again?
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Basic Questions about PostgreSQL.
2021-09-15 05:10 Basic Questions about PostgreSQL. A Z <poweruserm@live.com.au>
@ 2021-09-15 05:32 ` David G. Johnston <david.g.johnston@gmail.com>
3 siblings, 0 replies; 6+ messages in thread
From: David G. Johnston @ 2021-09-15 05:32 UTC (permalink / raw)
To: A Z <poweruserm@live.com.au>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On Wednesday, September 15, 2021, A Z <poweruserm@live.com.au> wrote:
> -In PostgreSQL, what is the difference between Roles, Groups
>
>
There is none, aside from convention. Roles are generic, groups don’t get
login rights while users do.
You might want to clarify what you mean by policy since referencing the
“create policy” command seems out of place here.
> -Is there a simple, immediate, straightforward way to temporarily disable
> PostgreSQL database
> use of all other users, except development users, or in fact just one user
> (one developer, yourself)
> so that maintenance on the data or the data model may be performed?
>
>
Manipulating the pg_hba.comf file is usually the most efficient method.
Though since connect privileges are usually left as strictly inherited from
public by default revoking connect from public will most likely prevent
non-superusers from connecting to databases.
Though it seems unusual that maintenance would require such extreme
measures to be taken.
David J.
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Basic Questions about PostgreSQL.
2021-09-15 05:10 Basic Questions about PostgreSQL. A Z <poweruserm@live.com.au>
@ 2021-09-15 08:38 ` rob stone <floriparob@gmail.com>
2021-09-15 11:56 ` Re: Basic Questions about PostgreSQL. Tom Lane <tgl@sss.pgh.pa.us>
3 siblings, 1 reply; 6+ messages in thread
From: rob stone @ 2021-09-15 08:38 UTC (permalink / raw)
To: A Z <poweruserm@live.com.au>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On Wed, 2021-09-15 at 05:10 +0000, A Z wrote:
> -In PostgreSQL, what is the difference between Roles, Groups, and
> Policies exactly? What are they each, how do they relate to one
> another, and which one(s) can be assigned to another?
>
> -Is there a simple, immediate, straightforward way to temporarily
> disable PostgreSQL database
> use of all other users, except development users, or in fact just one
> user (one developer, yourself)
> so that maintenance on the data or the data model may be performed?
>
Read
https://www.postgresql.org/docs/13/app-postgres.html#id-1.9.5.14.6.5
about single user mode.
You shut down the cluster and run psql in single user mode.
After you quit out of single user mode, restart.
HTH,
Rob
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Basic Questions about PostgreSQL.
2021-09-15 05:10 Basic Questions about PostgreSQL. A Z <poweruserm@live.com.au>
2021-09-15 08:38 ` Re: Basic Questions about PostgreSQL. rob stone <floriparob@gmail.com>
@ 2021-09-15 11:56 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2021-09-15 11:56 UTC (permalink / raw)
To: rob stone <floriparob@gmail.com>; +Cc: A Z <poweruserm@live.com.au>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
rob stone <floriparob@gmail.com> writes:
> On Wed, 2021-09-15 at 05:10 +0000, A Z wrote:
>> -Is there a simple, immediate, straightforward way to temporarily
>> disable PostgreSQL database
>> use of all other users, except development users, or in fact just one
>> user (one developer, yourself)
>> so that maintenance on the data or the data model may be performed?
> Read
> https://www.postgresql.org/docs/13/app-postgres.html#id-1.9.5.14.6.5
> about single user mode.
I think a better recommendation is to temporarily modify pg_hba.conf
to disallow logins you don't want. Single-user mode is pretty limited,
because what it really is is single-process mode: there will be no
background support processes such as bgwriter, autovacuum, replication
support, etc. The system runs, more or less, but performance is not
going to be great.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Basic Questions about PostgreSQL.
2021-09-15 05:10 Basic Questions about PostgreSQL. A Z <poweruserm@live.com.au>
@ 2021-09-15 13:19 ` Simon Riggs <simon.riggs@enterprisedb.com>
3 siblings, 0 replies; 6+ messages in thread
From: Simon Riggs @ 2021-09-15 13:19 UTC (permalink / raw)
To: A Z <poweruserm@live.com.au>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On Wed, 15 Sept 2021 at 06:10, A Z <poweruserm@live.com.au> wrote:
> -Is there a simple, immediate, straightforward way to temporarily disable PostgreSQL database
> use of all other users, except development users, or in fact just one user (one developer, yourself)
> so that maintenance on the data or the data model may be performed?
PostgreSQL doesn't require you to eject all other users while such
actions are performed, so we haven't spent a lot of time thinking
about how to deny people access.
What maintenance actions are you thinking are a problem?
--
Simon Riggs http://www.EnterpriseDB.com/
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: Basic Questions about PostgreSQL.
2021-09-15 05:10 Basic Questions about PostgreSQL. A Z <poweruserm@live.com.au>
@ 2021-09-15 14:25 ` Adrian Klaver <adrian.klaver@aklaver.com>
3 siblings, 0 replies; 6+ messages in thread
From: Adrian Klaver @ 2021-09-15 14:25 UTC (permalink / raw)
To: A Z <poweruserm@live.com.au>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
On 9/14/21 10:10 PM, A Z wrote:
> -In PostgreSQL, what is the difference between Roles, Groups, and
> Policies exactly? What are they each, how do they relate to one another,
> and which one(s) can be assigned to another?
>
Roles, groups and users have to do with project history more then
anything else. Prior to version 8.1 there where no roles, just users and
groups. Roles when introduced they subsumed users and groups. As David
mentioned then the convention became that a role that had login was
equivalent to a user and one that did not was a group. This is called
out in the documentation for the aliases CREATE GROUP and CREATE USER,
both of which actually point at CREATE ROLE.
Policies comes into play by allowing for more granular control over what
a role can do on a table.
--
Adrian Klaver
adrian.klaver@aklaver.com
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2021-09-15 14:25 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15 05:10 Basic Questions about PostgreSQL. A Z <poweruserm@live.com.au>
2021-09-15 05:32 ` David G. Johnston <david.g.johnston@gmail.com>
2021-09-15 08:38 ` rob stone <floriparob@gmail.com>
2021-09-15 11:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2021-09-15 13:19 ` Simon Riggs <simon.riggs@enterprisedb.com>
2021-09-15 14:25 ` Adrian Klaver <adrian.klaver@aklaver.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox