Language options for GIN index support functions

2023-02-06 Thread Phillip Diffley
Hello, The support functions and operator methods needed to extend a GIN index are documented in C syntax . Do these functions need to be implemented in C, or is there an interface for other languages like PL/pgSQL? Thanks! Phillip

What changes to a table cannot be detected by a trigger?

2023-10-01 Thread Phillip Diffley
Triggers can be set for insert, update, delete, and truncate operations. Alter table operations, like adding or dropping a column from a table, do not cause an update trigger to fire but can be captured by an event trigger. Are there any situations where the data in a table can be changed and the

How to generate random bigint

2023-12-20 Thread Phillip Diffley
Postgres's random() function generates a random double. That can be converted to a random int for smaller integers, but a double can't represent all of the values in a bigint. Is there a recommended way to generate a random bigint in Postgres? Thanks, Phillip

Re: How to generate random bigint

2023-12-22 Thread Phillip Diffley
lt;< 8*5) | (get_byte(bytes,6)::int8 << 8*6) | (get_byte(bytes,7)::int8 << 8*7); END; $$ LANGUAGE plpgsql; On Thu, Dec 21, 2023 at 6:14 AM Peter J. Holzer wrote: > > On 2023-12-21 00:06:39 -0600, Phillip Diffley wrote: > > Postgres's random() function generates a random doubl

Replication slot WAL reservation

2025-04-05 Thread Phillip Diffley
I am trying to understand how logical replication slots work, specifically in regard to how WAL is reserved and freed by a replication slot. My current understanding of the WAL (set to wal_level logical) is that: 1. Every DML operation (insert, update, delete, truncate) will have a row in the WAL

Create replication slot options

2025-04-05 Thread Phillip Diffley
I am testing out some streaming logical replication commands and am having trouble specifying options when calling CREATE_REPLICATION_SLOT . I connect to the database with psql "dbname=

Re: Replication slot WAL reservation

2025-03-25 Thread Phillip Diffley
estion! > > > On Mar 25, 2025, at 09:56, Phillip Diffley > wrote: > > But when processing data from a replication slot, we confirm rows that > have been processed and can be deleted from the WAL based on the LSN (eg. > with pg_replication_slot_advance). How does postgre

Re: Replication slot WAL reservation

2025-03-26 Thread Phillip Diffley
e replayed, since their data is freed for deletion. Is that correct? On Tue, Mar 25, 2025 at 11:32 PM Christophe Pettus wrote: > > > > On Mar 25, 2025, at 20:56, Phillip Diffley > wrote: > > > > Is there a message type that is used to confirm what logs have been &

Re: Replication slot WAL reservation

2025-03-25 Thread Phillip Diffley
oint of being crash-proof? On Tue, Mar 25, 2025 at 4:32 PM Christophe Pettus wrote: > > > > On Mar 25, 2025, at 13:58, Phillip Diffley > wrote: > > > > Oh I see! I was conflating the data I see coming out of a replication > slot with the internal organization of