Re: Grant read-only access to exactly one database amongst many

2024-02-05 Thread Graham Leggett
On 05 Feb 2024, at 00:54, David G. Johnston wrote: > I have a postgresql 15 instance with two databases in it, and I have a need > to grant read-only access to one of those databases to a given user. >> >> To do this I created a dedicated role for readonly access to the database >> db1: >> >>

Grant read-only access to exactly one database amongst many

2024-02-04 Thread Graham Leggett
Hi all, I have a postgresql 15 instance with two databases in it, and I have a need to grant read-only access to one of those databases to a given user. To do this I created a dedicated role for readonly access to the database db1: CREATE ROLE "dv_read_db1" GRANT CONNECT ON DATABASE db1 TO dv_r

Re: [PATCH] Log details for client certificate failures

2022-07-09 Thread Graham Leggett
On 01 Jul 2022, at 22:59, Jacob Champion wrote: >> I added this to httpd a while back: >> >> SSL_CLIENT_CERT_RFC4523_CEA >> >> It would be good to interoperate. > > What kind of interoperation did you have in mind? Are there existing > tools that want to scrape this information for observabili

Re: [PATCH] Log details for client certificate failures

2022-06-30 Thread Graham Leggett
On 30 Jun 2022, at 10:43, Peter Eisentraut wrote: > I wrote that pg_stat_ssl uses the *issuer* plus serial number to identify a > certificate. What your patch shows is the subject and the serial number, > which isn't the same thing. Let's get that sorted out one way or the other. Quick obse

Re: Feature: Use DNS SRV records for connecting

2019-08-13 Thread Graham Leggett
On 13 Aug 2019, at 11:50, Feike Steenbergen wrote: > I'd like to get some feedback on whether or not implementing a DNS SRV feature > for connecting to PostgreSQL would be desirable/useful. A big +1. We currently use SRV records to tell postgresql what kind of server it is. This way all of our

Re: DNS SRV support for LDAP authentication

2019-02-02 Thread Graham Leggett
On 02 Feb 2019, at 01:57, Thomas Munro wrote: > On Sat, Feb 2, 2019 at 9:25 AM Graham Leggett wrote: >> On 25 Sep 2018, at 04:09, Thomas Munro wrote: >>> Some people like to use DNS SRV records to advertise LDAP servers on >>> their network. Microsoft Active Directo

Re: DNS SRV support for LDAP authentication

2019-02-01 Thread Graham Leggett
On 25 Sep 2018, at 04:09, Thomas Munro wrote: > Some people like to use DNS SRV records to advertise LDAP servers on > their network. Microsoft Active Directory is usually (always?) set up > that way. Here is a patch to allow our LDAP auth module to support > that kind of discovery. Does this

Re: Is there a "right" way to test if a database is empty?

2018-01-17 Thread Graham Leggett
On 17 Jan 2018, at 6:34 PM, David G. Johnston wrote: > ​That was my original thought - though comparing the size of template1 to the > target database should be reasonably safe... > > If you do go for object detection you will want to ensure that no schemas > other than public exist in additi

Re: Is there a "right" way to test if a database is empty?

2018-01-17 Thread Graham Leggett
On 17 Jan 2018, at 5:47 PM, Graham Leggett wrote: > I need to test whether a database is empty, in other words “createdb” has > been executed but no data of any kind appears in that database. > > What is the correct postgresql way to do this? > > Is there a pg_isempty com

Re: Is there a "right" way to test if a database is empty?

2018-01-17 Thread Graham Leggett
On 17 Jan 2018, at 6:01 PM, pinker wrote: > I always do: \l+ and then you can compare the size: new_one | postgres | UTF8 > | en_US.UTF-8 | en_US.UTF-8 | | 7869 kB | pg_default | template0 | postgres | > UTF8 | en_US.UTF-8 | en_US.UTF-8 | =c/postgres +| 7869 kB | pg_default | | | > | | postgre

Is there a "right" way to test if a database is empty?

2018-01-17 Thread Graham Leggett
Hi all, I need to test whether a database is empty, in other words “createdb” has been executed but no data of any kind appears in that database. What is the correct postgresql way to do this? Is there a pg_isempty command or equivalent somewhere? Regards, Graham — smime.p7s Description: S/