Postgres 17 domains with NOT NULL and pg_get_constraintdef()

2025-01-08 Thread shammat
Hello, I am not sure if this is intended behavior or an oversight/bug. Assume the following domain definition: CREATE DOMAIN sample_domain AS numeric(12,2) NOT NULL constraint positive_value CHECK (value > 0); Up until Postgres 16 it was possible to retrieve the domain constraints using:

INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Ron Johnson
PG 14.13 The goal of "(now() - query_start)::INTERVAL MINUTE TO SECOND" column is to see how many minutes and seconds ago that the query started. (Why? Because that's useful to me, and the people I show the output to when queries run for more than a few minutes. We don't need to see hours and da

Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Adrian Klaver
On 1/8/25 11:00 AM, Ron Johnson wrote: PG 14.13 The goal of "(now() - query_start)::INTERVAL MINUTE TO SECOND" column is to see how many minutes and seconds ago that the query started.  (Why? Because that's useful to me, and the people I show the output to when queries run for more than a

Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Ron Johnson
On Wed, Jan 8, 2025 at 2:43 PM Adrian Klaver wrote: > > > On 1/8/25 11:00 AM, Ron Johnson wrote: > > PG 14.13 > > > > The goal of "(now() - query_start)::INTERVAL MINUTE TO SECOND" column is > > to see how many minutes and seconds ago that the query started. (Why? > > Because that's useful to me

Re: Postgres do not support tinyint?

2025-01-08 Thread Christophe Pettus
> On Jan 8, 2025, at 11:30, Igor Korot wrote: > There is no boolean - it is 0-4 inclusive. Unless you have somehow gotten PostgreSQL running on an IBM 7070, the range 0-4 can be represented by three binary digits, aka booleans. :-) To be serious, though, the situation is: 1. If there are ju

Re: Postgres do not support tinyint?

2025-01-08 Thread Igor Korot
Hi, Christopphe, On Wed, Jan 8, 2025 at 1:34 PM Christophe Pettus wrote: > > > > > On Jan 8, 2025, at 11:30, Igor Korot wrote: > > There is no boolean - it is 0-4 inclusive. > > Unless you have somehow gotten PostgreSQL running on an IBM 7070, the range > 0-4 can be represented by three binary

Re: Postgres do not support tinyint?

2025-01-08 Thread Alvaro Herrera
On 2025-Jan-08, Igor Korot wrote: > Also - there are not too many records in that table... In that case, you've probably wasted more time on this discussion than the computer will ever save by storing a smaller column. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread David G. Johnston
On Wednesday, January 8, 2025, vijay patil wrote: > Could you please advise how I can achieve password authentication without > using the pool_password file, while ensuring that Pgpool prompts for the > password during connection? > https://www.pgpool.net/docs/latest/en/html/runtime-config-conne

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread Tatsuo Ishii
> If we plan to use pool_hba.conf, then we must use the pool_passwd file to > maintain passwords for all database users. This approach requires that > every time a new user is created, their password is added to the pool_passwd > file. Not really. You can use pool_hba.conf with the auth method to

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread Tatsuo Ishii
> Thanks David, > > I tested the configuration by setting allow_clear_text_frontend_auth = on > and disabling the pool_hba. I made the corresponding entry in the > pg_hba.conf file. However, while connecting through the database port > (5432), it prompts for the password, but when connecting throu

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread David G. Johnston
On Wednesday, January 8, 2025, vijay patil wrote: > Pgpool needs to be restarted for the changes to take effect. > You should look for and leverage the difference between when something must be “restarted” and when it has provided a mechanism for “reloading”. David J.

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread vijay patil
Thanks David. On Thu, Jan 9, 2025 at 11:42 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wednesday, January 8, 2025, vijay patil > wrote: > >> Pgpool needs to be restarted for the changes to take effect. >> > > You should look for and leverage the difference between when somethi

Issue with Password Authentication for Pgpool

2025-01-08 Thread vijay patil
Hello Everyone, Need assistance on below requirements. My requirement is to prompt for a password when connecting through Pgpool (port ) and to avoid using the pool_password file. However, I’m currently getting the error related to the lack of an entry in the pool_passwd file. Could you plea

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread vijay patil
If we plan to use pool_hba.conf, then we must use the pool_passwd file to maintain passwords for all database users. This approach requires that every time a new user is created, their password is added to the pool_passwd file. The challenge with this method is that it becomes difficult to maintain

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread vijay patil
Thanks David, I tested the configuration by setting allow_clear_text_frontend_auth = on and disabling the pool_hba. I made the corresponding entry in the pg_hba.conf file. However, while connecting through the database port (5432), it prompts for the password, but when connecting through Pgpool (p

Re: Issue with Password Authentication for Pgpool

2025-01-08 Thread David G. Johnston
On Wednesday, January 8, 2025, vijay patil wrote: > This behavior might be related to how Pgpool handles authentication. > Having never used pgpool I very well could be wrong but from what I can gather what you want to do is simply not possible within the current design of pgpool. Namely you ha

Re: Unexpected results from a query with UNION ALL

2025-01-08 Thread Tom Lane
I wrote: > Andrey writes: >> ... but I would expect to get the same result as previously. Is it a bug >> or am I doing something wrong here? > It's a surprising result for sure, but I believe it's explained by > the algorithm for READ COMMITTED [1], specifically the bit about Actually, on furthe

Re: Postgres 17 domains with NOT NULL and pg_get_constraintdef()

2025-01-08 Thread Alvaro Herrera
On 2025-Jan-08, sham...@gmx.net wrote: Hello, > However, because the domain is defined with NOT NULL, this fails with > > > ERROR: invalid constraint type "n" > > with 17.2 on Windows and Linux. > > This is a result of storing the NOT NULL constraint in pg_constraint > and can easily be avoide

Re: Postgres 17 domains with NOT NULL and pg_get_constraintdef()

2025-01-08 Thread shammat
Am 08.01.25 um 14:10 schrieb Alvaro Herrera: However, because the domain is defined with NOT NULL, this fails with ERROR: invalid constraint type "n" with 17.2 on Windows and Linux. This is a result of storing the NOT NULL constraint in pg_constraint and can easily be avoided by either using

Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Adrian Klaver
On 1/8/25 11:58 AM, Ron Johnson wrote: On Wed, Jan 8, 2025 at 2:43 PM Adrian Klaver > wrote: > I'd hoped that ::INTERVAL MINUTE TO SECOND would do the trick, but > MINUTE TO SECOND seems to be ignored.  From here: https://www.postgres

Re: Postgres do not support tinyint?

2025-01-08 Thread Igor Korot
Hi, Christophe, On Wed, Jan 8, 2025 at 12:49 AM Christophe Pettus wrote: > > > > > On Jan 7, 2025, at 22:44, David G. Johnston > > wrote: > > > > You suggest a type with a minimum size of 6 bytes when the complaint is > > that the otherwise acceptable 2 byte data type is too large? > > Althoug

Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do

2025-01-08 Thread Ron Johnson
On Wed, Jan 8, 2025 at 3:07 PM Adrian Klaver wrote: > > > On 1/8/25 11:58 AM, Ron Johnson wrote: > > On Wed, Jan 8, 2025 at 2:43 PM Adrian Klaver > > wrote: > > > > > > I'd hoped that ::INTERVAL MINUTE TO SECOND would do the trick, but > > > MINUTE TO