ERROR: could not read block 0 in file when creating an index out of a function

2025-03-12 Thread Luca Ferrari
Hi all, this is a little controversial, but hagin a function defined as immutable that selects a record out of a table, it is impossible to create an index over such function if the column has a constraint like a primary key. Here it is the use case: DROP TABLE if exists t; drop table if exist

Re: Moving from Linux to Linux?

2025-03-12 Thread Paul Foerster
Hi Ron, > On 11 Mar 2025, at 20:34, Ron Johnson wrote: > > If you don't do much DDL, the LR should be quite workable. DDL during logical replication unfortunately is a show-stopper. Cheers, Paul

Re: ERROR: could not read block 0 in file when creating an index out of a function

2025-03-12 Thread Tom Lane
Luca Ferrari writes: > On Wed, Mar 12, 2025 at 12:54 PM Artur Zakirov wrote: >> In your case `base/357283/365810` file is a new index file. For some >> reason Postgres tries to read the new index. I suppose this is because >> during reading the table `t` within the function `f_t` it tries to >> a

Re: ERROR: could not read block 0 in file when creating an index out of a function

2025-03-12 Thread Artur Zakirov
Hey, On Wed, 12 Mar 2025 at 10:11, Luca Ferrari wrote: > Now, according to the documentation, the function f_t is immutable > since it is not modifying the database, so what is going on? And why > is the same function working if the table has not the constraint on > the column? I can reproduce t

Re: ERROR: could not read block 0 in file when creating an index out of a function

2025-03-12 Thread Achilleas Mantzios - cloud
On 3/12/25 14:31, Luca Ferrari wrote: On Wed, Mar 12, 2025 at 12:54 PM Artur Zakirov wrote: I can reproduce this with the table `t` on PG 15.10. I didn't mention I'm running 16.6, but I'm pretty sure it is reproducible on other versions too. In your case `base/357283/365810` file is a new in

Re: Duplicate Key Values

2025-03-12 Thread Adrian Klaver
On 3/12/25 08:46, Adrian Klaver wrote: On 3/11/25 13:24, Adrian Klaver wrote: On 3/11/25 12:55, mark bradley wrote: It happened again.  Now there are no sequences (although there once was). Read my previous post and provide the information requested. Mark sent me the below, which answers s

Re: Moving from Linux to Linux?

2025-03-12 Thread Paul Foerster
Hi Greg, > On 12 Mar 2025, at 21:31, Greg Sabino Mullane wrote: > > Keep in mind that you only need to reindex text-based indexes. Ints are still > gonna int. So it might not be too bad. Yes, I know, but unfortunately the worst case index of them all will still take a few hours. Cheers, Paul

Re: Moving from Linux to Linux?

2025-03-12 Thread Ron Johnson
On Wed, Mar 12, 2025 at 4:16 PM Paul Foerster wrote: > Hi Ron, > > > On 12 Mar 2025, at 17:59, Ron Johnson wrote: > > > > Developers making DDL changes on production databases? > > Of course not. But I can't block developer databases. That'd make a few > hundred developers happy. > > > Or are th

Re: Moving from Linux to Linux?

2025-03-12 Thread Joe Conway
On 3/12/25 16:55, Paul Foerster wrote: Hi Adrian, On 12 Mar 2025, at 21:26, Adrian Klaver wrote: A good summary of the glibc issue: https://wiki.postgresql.org/wiki/Locale_data_changes With distro information: https://wiki.postgresql.org/wiki/Locale_data_changes#What_Linux_distributions_ar

Re: Duplicate Key Values

2025-03-12 Thread Adrian Klaver
On 3/11/25 13:24, Adrian Klaver wrote: On 3/11/25 12:55, mark bradley wrote: It happened again.  Now there are no sequences (although there once was). Read my previous post and provide the information requested. Mark sent me the below, which answers some of the questions, namely there is i

Re: ERROR: could not read block 0 in file when creating an index out of a function

2025-03-12 Thread Luca Ferrari
On Wed, Mar 12, 2025 at 12:54 PM Artur Zakirov wrote: > > I can reproduce this with the table `t` on PG 15.10. I didn't mention I'm running 16.6, but I'm pretty sure it is reproducible on other versions too. > > In your case `base/357283/365810` file is a new index file. For some > reason Postgr

Re: Moving from Linux to Linux?

2025-03-12 Thread Paul Foerster
Hi Christophe, > On 12 Mar 2025, at 12:16, Christophe Pettus wrote: > > You *can* apply DDL while logical replication is going on, as long as you do > so in a disciplined way. This generally means applying it to the subscriber > before you apply it to the publisher, and making sure that any c

Re: Moving from Linux to Linux?

2025-03-12 Thread Ron Johnson
On Wed, Mar 12, 2025 at 12:48 PM Paul Foerster wrote: > Hi Christophe, > > > On 12 Mar 2025, at 12:16, Christophe Pettus wrote: > > > > You *can* apply DDL while logical replication is going on, as long as > you do so in a disciplined way. This generally means applying it to the > subscriber be

Re: Moving from Linux to Linux?

2025-03-12 Thread Greg Sabino Mullane
On Tue, Mar 11, 2025 at 2:35 PM Paul Foerster wrote: > The question was a bit of an idea. So the glibc version in not known yet, > but I'm highly confident that they will differ. A reindex could in theory > be possible in most cases, but is a definite show stopper on some of our > databases, beca

Re: Moving from Linux to Linux?

2025-03-12 Thread Paul Foerster
Hi Adrian, > On 12 Mar 2025, at 21:26, Adrian Klaver wrote: > > A good summary of the glibc issue: > > https://wiki.postgresql.org/wiki/Locale_data_changes > > With distro information: > > https://wiki.postgresql.org/wiki/Locale_data_changes#What_Linux_distributions_are_affected I know the a

Re: Moving from Linux to Linux?

2025-03-12 Thread Paul Foerster
Hi Ron, > On 12 Mar 2025, at 21:50, Ron Johnson wrote: > > No, I think it's 100% on point: logically replicate the Prod databases, while > pg_dump/pg_restore of the dev and pre-prod databases happen on weekends. Yes, I live for and in the company. 🤣 SNCR. No, seriously, I'm one of only two Po

Re: Moving from Linux to Linux?

2025-03-12 Thread Adrian Klaver
On 3/11/25 11:34, Paul Foerster wrote: Hi Devrim, Thomas, Adrian, Ron, Joe, answering to myself as answering to five postings in one go is impossible. 🤣 Are there any obstacles that definitely make that a no-go? Do I risk corruption? It's both Linux, just a different distribution. The quest

Re: Moving from Linux to Linux?

2025-03-12 Thread Adrian Klaver
On 3/12/25 13:55, Paul Foerster wrote: Hi Adrian, On 12 Mar 2025, at 21:26, Adrian Klaver wrote: A good summary of the glibc issue: https://wiki.postgresql.org/wiki/Locale_data_changes With distro information: https://wiki.postgresql.org/wiki/Locale_data_changes#What_Linux_distributions_ar