Re: foreign keys on multiple parent table

2023-06-21 Thread Dominique Devienne
On Tue, Jun 20, 2023 at 10:47 PM Lorusso Domenico wrote: > Could work, but is there a way to set a reference key over the uuid of all > the tables? > Yes, it's possible. We do it. There are several ways to emulate what I call "polymorphic" FKs. All approaches have pros and cons, the one we use

Re: strange behavior of .pgpass file

2023-06-21 Thread Laurenz Albe
On Wed, 2023-06-21 at 00:29 +0530, Atul Kumar wrote: > I found some strange behaviour of postgres superuser password in my existing > cluster, below is the basic outline of the setup. > 1. version - postgres 12 > 2. replication - streaming replication async > 3. OS- centos7 > 4. One Master, One St

libpq: What can and cannot be bound? How to know?

2023-06-21 Thread Dominique Devienne
For example with [NOTIFY][1]. The doc states: > Payload: This must be specified as a simple string literal Does that mean we cannot bind the payload? I.e. the pseudo code: ``` conn.exec(bind(msg), "NOTIFY {} $1", conn.escapeName(channel)); ``` is invalid? And I must use instead ``` conn.exec("NO

Re: pb with join plan

2023-06-21 Thread Tomas Vondra
On 6/21/23 00:26, Marc Millas wrote: > > > On Tue, Jun 20, 2023 at 11:19 PM David Rowley > wrote: > > On Wed, 21 Jun 2023 at 08:34, Marc Millas > wrote: > > > > On Tue, Jun 20, 2023 at 10:14 PM David Rowley > mailt

Re: libpq: What can and cannot be bound? How to know?

2023-06-21 Thread Laurenz Albe
On Wed, 2023-06-21 at 11:00 +0200, Dominique Devienne wrote: > For example with [NOTIFY][1]. The doc states: > > > Payload: This must be specified as a simple string literal > > Does that mean we cannot bind the payload? > I.e. the pseudo code: > ``` > conn.exec(bind(msg), "NOTIFY {} $1", conn.es

Re: libpq: What can and cannot be bound? How to know?

2023-06-21 Thread Dominique Devienne
On Wed, Jun 21, 2023 at 1:52 PM Laurenz Albe wrote: > On Wed, 2023-06-21 at 11:00 +0200, Dominique Devienne wrote: > > [...] obvious way to know what can and cannot be bound, just from the > doc? > > This is not adequately documented. Bummer. > The documentation for PREPARE says: > Note that

Re: libpq: What can and cannot be bound? How to know?

2023-06-21 Thread David G. Johnston
On Wed, Jun 21, 2023 at 6:09 AM Dominique Devienne wrote: > > I'm sure there are good technical reason. But from the outside, it is > surprising and a bit inconsistent. > > The planner is the thing that handles binds. The only things that are planned are queries - i.e., SQL commands that are cap

Re: pb with join plan

2023-06-21 Thread Marc Millas
On Wed, Jun 21, 2023 at 12:43 PM Tomas Vondra wrote: > On 6/21/23 00:26, Marc Millas wrote: > > > > > > On Tue, Jun 20, 2023 at 11:19 PM David Rowley > > wrote: > > > > On Wed, 21 Jun 2023 at 08:34, Marc Millas > > wrote: > >

Re: libpq: What can and cannot be bound? How to know?

2023-06-21 Thread Dominique Devienne
On Wed, Jun 21, 2023 at 4:20 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > The planner is the thing that handles binds. [...] > Depends what you mean by "handles", since when I asked about "bind peeking" during planning, I think the answer was that it was not supported. So I don't

Re: pb with join plan

2023-06-21 Thread Marc Millas
Marc MILLAS On Wed, Jun 21, 2023 at 12:43 PM Tomas Vondra wrote: > On 6/21/23 00:26, Marc Millas wrote: > > > > > > On Tue, Jun 20, 2023 at 11:19 PM David Rowley > > wrote: > > > > On Wed, 21 Jun 2023 at 08:34, Marc Millas >

PostgreSQL Server Hang​

2023-06-21 Thread KK CHN
*Description of System: * 1. We are running a Postgres Server (version 12, on CentOS 6) for an emergency call attending and vehicle tracking system fitted with mobile devices for vehicles with navigation apps for emergency service. 2. vehicles every 30 Seconds sending location coordinates( Lat

Re: PostgreSQL Server Hang​

2023-06-21 Thread Andreas Kretschmer
On 22 June 2023 07:09:26 CEST, KK CHN wrote: >*Description of System: * >1. We are running a Postgres Server (version 12, on CentOS 6) for an >emergency call attending and vehicle tracking system fitted with mobile >devices for vehicles with navigation apps for emergency service. > >2. vehic