Re: Records, Types, and Arrays

2023-05-19 Thread Raymond Brinzer
On Fri, May 19, 2023 at 2:58 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thursday, May 18, 2023, Raymond Brinzer wrote: > >> scratch=# select row(2,3)::test_type; >> > > Unknown typed value, immediately converted to a known concrete instance of > test_type. It is never

Re: Records, Types, and Arrays

2023-05-19 Thread Raymond Brinzer
On a problem which came up while trying to implement a solution, perhaps someone could explain this: scratch=# create type test_type as (a int, b int); CREATE TYPE scratch=# create function get_row() returns record as $$ select row(2,3); $$ language sql; CREATE FUNCTION scratch=# select

Re: Records, Types, and Arrays

2023-05-19 Thread David G. Johnston
On Thursday, May 18, 2023, Raymond Brinzer wrote: > > scratch=# select row(2,3)::test_type; > Unknown typed value, immediately converted to a known concrete instance of test_type. It is never actually resolved as record. All of the others must concretely be resolved to record to escape their

Re: Records, Types, and Arrays

2023-05-19 Thread Raymond Brinzer
Sorry, I should have noted this as well: "One should also realize that when a PL/pgSQL function is declared to return type record, this is not quite the same concept as a record variable, even though such a function might use a record variable to hold its result. In both cases the actual row

Re: Records, Types, and Arrays

2023-05-19 Thread Raymond Brinzer
On Fri, May 19, 2023 at 1:42 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, May 18, 2023 at 10:06 PM Raymond Brinzer > wrote: > >> How do I turn arrays into composite typed values? >> > > Using just SQL syntax and no string munging: > > (array_val[1]::col1_type,

Re: Records, Types, and Arrays

2023-05-19 Thread Pavel Stehule
Hi pá 19. 5. 2023 v 8:59 odesílatel Raymond Brinzer napsal: > Sorry, I should have noted this as well: > > "One should also realize that when a PL/pgSQL function is declared to > return type record, this is not quite the same concept as a record > variable, even though such a function might use

Re: pg_stats.avg_width

2023-05-19 Thread Maciek Sakrejda
Thanks, that makes sense. It was going to be my third guess, but it seemed pretty wide for a TOAST pointer. Reviewing what goes in there, though, it's reasonable. I assume that this means for unTOASTed but compressed data, this counts the compressed size. Would a doc patch clarifying this (and

Re: a simple-minded question about updating

2023-05-19 Thread Adrian Klaver
On 5/19/23 07:25, Martin Mueller wrote: I currently work with Postgres 13. I forgot to mention that. From which I gather that around version 18 it would be time to upgrade. But in the interim I’d be OK. Right? Strictly speaking yes, though the longer you wait the greater the number of

Re: Is there a good way to handle sum types (or tagged unions) in PostgreSQL?

2023-05-19 Thread Victor Nordam Suadicani
On Fri, 19 May 2023 at 12:44, Dominique Devienne wrote: > On Thu, May 18, 2023 at 2:28 PM Victor Nordam Suadicani < > v.n.suadic...@gmail.com> wrote: > >> Is there any nice way to handle sum types (aka tagged unions) in a >> PostgreSQL database? [...] >> > A third method would be to save all

Re: Trying to understand a failed upgrade in AWS RDS

2023-05-19 Thread Mike Lissner
I also am realizing belatedly that my solution of dropping the subscriber probably won't work anyway, since I'd lose the changes on the publisher for the duration of the upgrade. Maybe I could drop the subscription while keeping the slot on the publisher, and then create a new subscription after

Re: a simple-minded question about updating

2023-05-19 Thread Martin Mueller
I currently work with Postgres 13. I forgot to mention that. From which I gather that around version 18 it would be time to upgrade. But in the interim I’d be OK. Right? From: Adrian Klaver Date: Thursday, May 18, 2023 at 11:21 PM To: Martin Mueller , pgsql-general@lists.postgresql.org

Trying to understand a failed upgrade in AWS RDS

2023-05-19 Thread Mike Lissner
Hi all, In AWS RDS, we are using logical replication between a postgresql 14 publisher and a postgresql 10 subscriber. The subscriber is rather old, so yesterday I tried to update it using AWS's built in upgrade tool (which uses pg_upgrade behind the scenes). I did a pretty thorough test run

Re: PostgreSQL 13 - Logical Replication - ERROR: could not receive data from WAL stream: SSL SYSCALL error: EOF detected

2023-05-19 Thread FOUTE K . Jaurès
Le ven. 19 mai 2023 à 05:02, Kyotaro Horiguchi a écrit : > At Thu, 18 May 2023 21:00:08 +0100, FOUTE K. Jaurès > wrote in > > Hello everyone, > > > > I have a replication between PostgreSQL 12 to 13 in the production > system. > > Using Ubuntu 18.04 LTS > > We have this error today. > > > > > >

Re: Is there a good way to handle sum types (or tagged unions) in PostgreSQL?

2023-05-19 Thread Dominique Devienne
On Thu, May 18, 2023 at 2:28 PM Victor Nordam Suadicani < v.n.suadic...@gmail.com> wrote: > Is there any nice way to handle sum types (aka tagged unions) in a > PostgreSQL database? [...] > A third method would be to save all fields of all variants into a single > table, with all fields being

How to connect with PostgreSQL Database with SSL using Certificates and Key from client Eclipse in Java

2023-05-19 Thread sujay kadam
Hi Team. I am trying to connect with PostgreSQL database from client with SSL enabled on server 10.30.32.186 port 6432 using below java code - I am using certificates ( [server-cert.pem, server-key.pem, ca.cert] and [postgresql.crt, postgresql.pk8, root.crt] ). Suggest me if there are any

Re: Records, Types, and Arrays

2023-05-19 Thread David G. Johnston
The convention here is to inline or, at worse, bottom post, trimming irrelevant context. On Friday, May 19, 2023, Raymond Brinzer wrote: > > I'm guessing that row() isn't really a function, then? And even so, > assuming this is the important difference, how is the ability to change row >

Modeling combinations (options and dependencies)

2023-05-19 Thread eacil
Hello. I am struggling for the longest time about data I can't fit into a satisfying model. I thought about giving up about this project many times... Context: it's for a web server so speed is of the essence. It's an amateur project so expect cheap server. I am also more a novice than a

Unexpected cross-database vacuum impact with hot_standby_feedback=on

2023-05-19 Thread Owen Stephens
Hi, We are seeing that vacuum is prevented from cleaning dead tuples by an open transaction in a different database (where both connections are made against the primary server) when hot_standby_feedback = on but not when it is off. Is this cross-database interaction an expected effect of enabling

Re: Trying to understand a failed upgrade in AWS RDS

2023-05-19 Thread Mike Lissner
Thanks for the suggestions. I think in the future I'll do something like this rather than try to re-use existing subscriptions. I'm still trying to understand what went wrong though. Putting a finer point on my question: Does pg_upgrade mess up disabled subscriptions? On Fri, May 19, 2023 at

Re: Modeling combinations (options and dependencies)

2023-05-19 Thread Peter J. Holzer
On 2023-05-18 19:21:23 +, eacil wrote: > - > DATA > - > > -You have objects that are linked to many tables describing their > properties, such as an object__tag table. > -These objects are sold in releases. > -Thing is,

Re: Trying to understand a failed upgrade in AWS RDS

2023-05-19 Thread Elterman, Michael
Please, use the following runbook. 1. Disable the subscription to pg10. 2. Disable Application Users on Publisher. 3. Drop all replication slots on Publisher (The upgrade can not be executed if there are any replication slots) 4. Run RDS's upgrade (which runs pg_upgrade). 5. Recreate replication

Re: Is there a good way to handle sum types (or tagged unions) in PostgreSQL?

2023-05-19 Thread Peter J. Holzer
On 2023-05-19 16:55:00 +0200, Victor Nordam Suadicani wrote: > Thanks for the perspective :) > > > If you need SQL, you need to design for SQL for the get go. Not shoehorn > > your > > Rust data model into SQL. > > Sometimes the data in the domain really does fit a sum type and then a sum >

Re: Unexpected cross-database vacuum impact with hot_standby_feedback=on

2023-05-19 Thread Laurenz Albe
On Thu, 2023-05-18 at 17:34 +0100, Owen Stephens wrote: > We are seeing that vacuum is prevented from cleaning dead tuples by an open > transaction in a different database (where both connections are made against > the > primary server) when hot_standby_feedback = on but not when it is off. Is

Profiling a function call

2023-05-19 Thread Tiffany Thang
Hi, I have a function that has been executing for a long time and not returning any results. Wait event=NULL so it seems like it is still executing and not waiting on any specific resources. Is there a way to profile the function call to get an idea of what it is currently executing within the

Re: Trying to understand a failed upgrade in AWS RDS

2023-05-19 Thread Julien Rouhaud
On Sat, 20 May 2023, 05:56 Mike Lissner, wrote: > > I'm still trying to understand what went wrong though. Putting a finer > point on my question: Does pg_upgrade mess up disabled subscriptions? > yes, whether they're disabled or not. As far as I know it's impossible to reliably pg_upgrade a