Re: Questions on Upgrading PostgreSQL from 15.0 to 15.9 and Setting Up Streaming Replication

2024-11-24 Thread Christophe Pettus
> On Nov 24, 2024, at 09:03, Subhash Udata wrote: > When we shut down the standby, upgrade it, and then start it back up, will > the replication automatically resume from the primary to the standby? Assuming that the standby has access to any WAL generated during the shutdown (either still i

Re: License question

2024-11-25 Thread Christophe Pettus
> On Nov 21, 2024, at 21:40, prashant sinha wrote: > Is there a free version of PostgreSQL available which I can use without > buying any licenses? In case I want to self install and manage the database? > Just need guidance if I can install the available version from site for > business pur

Re: Questions on Upgrading PostgreSQL from 15.0 to 15.9 and Setting Up Streaming Replication

2024-11-24 Thread Christophe Pettus
> On Nov 24, 2024, at 09:15, Ron Johnson wrote: > > Doesn't the existence of a replication slot force PG to retain WAL files when > replication is broken? It does. I don't recall if the OP said that they were using a persistent replication slot or not; it's not as common with binary replic

Re: License question

2024-11-25 Thread Christophe Pettus
ort for enterprise. Also not sure if we can install on any > supported license for on-Prem server or we have to buy specific server > recommended by PostgreSQL. Will appreciate your guidance here. > > Thanks, > Prashant > > > Sent from Yahoo Mail for iPhone > > O

Re: Postgres do not support tinyint?

2025-01-07 Thread Christophe Pettus
> On Jan 7, 2025, at 22:26, Igor Korot wrote: > I don't see the "bit" field here: > https://www.postgresql.org/docs/current/datatype-numeric.html... https://www.postgresql.org/docs/current/datatype-bit.html

Re: old OS

2025-02-04 Thread Christophe Pettus
> On Feb 4, 2025, at 09:49, Marc Millas wrote: > My question is: is there any possibility to find something ? > and/or what is the latest psql available on a redhat 6.5 ? Although I've not done so, it should be possible to build from source even on a system that old.

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-07 Thread Christophe Pettus
> 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? Although it's not clear from the OP's question, if there are going to be a significant number of

Re: Initial Postgres admin account setup using Ansible?

2024-12-31 Thread Christophe Pettus
On Dec 31, 2024, at 13:31, Nick wrote: > What is the proper (secure) way to let the Ansible POSIX user manage > postgres? It seems there should be a fully automated way to bootstrap > an Ansible user for `postgres`. This is generally done with "become" and "become_user" in a shell command, somet

Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000

2025-03-22 Thread Christophe Pettus
> On Mar 22, 2025, at 21:37, Kevin Stephenson wrote: > > Christophe and Tom, thank you for your responses, but I'm still a bit > confused. In my original email, the Test 2 case is allowing a ROLLBACK in the > EXCEPTION clause without throwing an error. Is it a NOP ROLLBACK being > applied t

Re: pgvector as standard PostgreSQL feature?

2025-03-21 Thread Christophe Pettus
> On Mar 19, 2025, at 07:47, Sebastien Flaesch > wrote: > > Is there a plan to get pgvector's types (vector, halfvec, sparsevec, bit) > implemented as native built-in data types like json/jsonb ? (I'm speaking just for myself here.) I would not base any plans on this functionality being a

Re: Create replication slot options

2025-03-24 Thread Christophe Pettus
> On Mar 24, 2025, at 17:31, Phillip Diffley wrote: > > 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=replication_test_db replication=database" >

Re: [EXTERNAL] RDS IO Read time

2025-04-05 Thread Christophe Pettus
> On Mar 31, 2025, at 12:36, Eden Aharoni wrote: > Hope you’ll have any clue 😊 Based on that, I'd take it up with AWS. It does seem that the EBS mount is under-performing.

Re: Replication slot WAL reservation

2025-03-25 Thread Christophe Pettus
Missed this question! > 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 postgres identify what par

Re: Replication slot WAL reservation

2025-03-26 Thread Christophe Pettus
> On Mar 26, 2025, at 07:55, Phillip Diffley wrote: > Just to confirm, it sounds like the order messages are sent from the output > plugin is what matters here. When you update confirmed_flush_lsn to LSN "A", > any messages that were sent by the output plugin after the message with LSN > "A"

Re: Trying to dynamically create a procedure

2025-03-26 Thread Christophe Pettus
> On Mar 26, 2025, at 13:27, Dirschel, Steve > wrote: > > I think the problem has to do with having AS $$ and END $$ with the 2 $’s. PostgreSQL's multiline-string syntax is quite flexible. You can do things like: DO $doblock$ ... $doblock$ LANGUAGE plpgsql; I tend to put the name of th

Re: Replication slot WAL reservation

2025-03-25 Thread Christophe Pettus
> On Mar 25, 2025, at 20:56, Phillip Diffley wrote: > > Is there a message type that is used to confirm what logs have been > successfully consumed? You're looking for Standby Status Update: https://www.postgresql.org/docs/current/protocol-replication.html#PROTOCOL-REPLICATION-STAN

Re: Changing default fillfactor for the whole database

2025-04-27 Thread Christophe Pettus
> On Apr 27, 2025, at 06:54, Ron Johnson wrote: > > I agree with him, though, that this a foot-gun: most table's aren't that > UPDATE heavy. There is plenty of precedent for GUCs that seem to be useful, but really should never be touched except in the case of fairly uncommon workloads. Ho

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Christophe Pettus
> On Apr 28, 2025, at 15:58, Christophe Pettus wrote: > It does require knowing which of the VALUES is the key value being inserted > (pseudocode syntax above) [...] The instant after I hit send, I realized that information is available to the function by lining up the $names an

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Christophe Pettus
> On Apr 28, 2025, at 15:36, Tim Starling wrote: > function upsert( $table, $names, $values, $key, $set ) { >if ( $this->type === 'mysql' ) { >$conflict = 'ON DUPLICATE KEY UPDATE'; >} else { >$conflict = "ON CONFLICT ($key) DO UPDATE SET"; >} >return $this->quer

Re: Changing default fillfactor for the whole database

2025-04-26 Thread Christophe Pettus
> On Apr 26, 2025, at 19:31, Marcelo Fernandes wrote: > Does this make sense? Have I missed something about being able to change this > on a database level? You haven't missed anything; there's no setting that controls the default for fillfactor. Everyone's use-case is different, of course,

Re: Feature Proposal: Column-Level DELETE Operation in SQL

2025-04-23 Thread Christophe Pettus
> On Apr 21, 2025, at 09:53, Abhishek Hatgine > wrote: > However, there’s no specific, expressive way to delete the value of a column > directly. The typical workaround is to use: > UPDATE Customers SET Address = NULL WHERE CustomerID = 103; I'm not sure I agree that's unexpressive. When yo

Re: To take backup of Postgresql Database without large objects

2025-04-11 Thread Christophe Pettus
> On Apr 11, 2025, at 22:34, sivapostg...@yahoo.com wrote: > Then I've misunderstood large objects. Is there document to explain large > objects? Large objects are a relatively old and now little-used feature of PostgreSQL that predates the bytea type: https://www.postgresql.org/d

Re: Please implement a catch-all error handler per row, for COPY

2025-03-02 Thread Christophe Pettus
> On Mar 2, 2025, at 19:44, me nefcanto wrote: > > As I have specified in the bug thread, from 11 RDBMSs, 7 support this. Thus > it's not an uncommon weird request. If your organization is interested in producing a design and a patch, or paying a developer or organization to do so, that wou

Re: Big script execution

2025-03-11 Thread Christophe Pettus
> On Mar 10, 2025, at 09:35, Igor Korot wrote: > > Will the tables also be deleted? > The CREATE TABLE statements are part of this big transaction. Yes. DDL is transactional in PostgreSQL just like DML.

Re: Moving from Linux to Linux?

2025-03-13 Thread Christophe Pettus
> On Mar 13, 2025, at 10:10, Paul Foerster wrote: > > Is C.UTF8 really the same as en_US.UTF8? No. C.UTF8 sorts on Unicode code points, which will be (somewhat) different from en_US.UTF8. If you want a collation that is "good enough" across multiple languages, the ICU collation und-x-icu

Re: Moving from Linux to Linux?

2025-03-13 Thread Christophe Pettus
> On Mar 12, 2025, at 11:01, Paul Foerster wrote: > DDL during logical replication unfortunately is a show-stopper. 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

Re: Question on Alerts

2025-02-16 Thread Christophe Pettus
> On Feb 16, 2025, at 12:31, sud wrote: > where exactly I can get the source code for check_postgres and > check_pgactivity? https://github.com/bucardo/check_postgres https://github.com/OPMDG/check_pgactivity While the list is happy to help, I should note that I found these by searching fo

Re: SQL Server's WITH (NOLOCK) equivalent in PostgreSQL?

2025-03-30 Thread Christophe Pettus
> On Mar 30, 2025, at 21:44, 이현진 wrote: > Since PostgreSQL uses MVCC, I'm wondering what the best practice is for > non-blocking reads, > and whether there's an equivalent to dirty reads or READ UNCOMMITTED. There are two different questions here. 1. Reads are not blocked in PostgreSQL by w

Re: [EXTERNAL] RDS IO Read time

2025-03-31 Thread Christophe Pettus
> On Mar 31, 2025, at 10:32, Eden Aharoni wrote: > > First, thanks for the reply :) > So, I do know which part is taking a lot of IO time and it's to be honest any > node that reads from the disk.. of course, we're running EXPLAIN on our > queries (to be more specific we use auto_explain) bu

Re: RDS IO Read time

2025-03-31 Thread Christophe Pettus
> On Mar 31, 2025, at 06:54, Eden Aharoni wrote: > Is this expected IO read rate? I can’t help but feel we’re missing something > here.. Really, no particular I/O rate is "expected": if PostgreSQL needs that much data, it'll use that much I/O to get it. From your description, it's likely t

Re: [EXTERNAL] RDS IO Read time

2025-03-31 Thread Christophe Pettus
> On Mar 31, 2025, at 10:54, Eden Aharoni wrote: > > So you believe it's strictly an EBS issue? Well, PostgreSQL certainly can read faster than 34MB/s off of disk. With the data you've given, I can't really say if it's purely an EBS issue.

Re: Replication slot WAL reservation

2025-04-04 Thread Christophe Pettus
> 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 the WAL. I think the more specific question > I am trying to answer is, as a consumer of a replication slot, how do I > reas

Re: Nested Stored Procedures - ERROR: invalid transaction termination 2D000

2025-03-22 Thread Christophe Pettus
Hello, > On Mar 22, 2025, at 08:38, Kevin Stephenson wrote: > • When a top-level stored procedure is called it implicitly creates a TX > if there is no current TX. > • When a BEGIN/EXCEPTION block is used it implicitly creates a subTX for > that block. These statements are correct. >

Re: Determine server version from psql script

2025-03-23 Thread Christophe Pettus
> On Mar 23, 2025, at 18:08, Igor Korot wrote: > CREATE TRIGGER playersinleague_insert AFTER INSERT ON playersinleague > WHEN new.current_rank IS NULL The WHEN predicate has to be enclosed in parenthes: CREATE TRIGGER playersinleague_insert AFTER INSERT ON playersinleague WHEN (

Re: Best way to check if a table is empty

2025-03-23 Thread Christophe Pettus
> On Mar 23, 2025, at 21:15, David G. Johnston > wrote: > > No idea if we take that shortcut. I remember looking into that not too long ago, and the answer's no.

Re: Best way to check if a table is empty

2025-03-23 Thread Christophe Pettus
> On Mar 23, 2025, at 20:42, Marcelo Fernandes wrote: > Cons: > 1. Sequential Scan > 2. If the table is bloated, it reads more buffers. These concerns probably sound worse than they really are. Assuming the table is being vacuumed reliably, and is receiving inserts, those inserts will tend

Re: Replication slot WAL reservation

2025-03-25 Thread Christophe Pettus
> On Mar 25, 2025, at 09:56, Phillip Diffley wrote: > 1. Every DML operation (insert, update, delete, truncate) will have a row in > the WAL and that row will have an LSN assigned to it. > 2. The LSNs are assigned when the operation happens. > 3. Operations within a transaction are written to

Re: [EXTERNAL] RDS IO Read time

2025-04-04 Thread Christophe Pettus
> On Mar 31, 2025, at 11:30, Eden Aharoni wrote: > > Can you please tell me what other data might help? You can show your work on how you got the megabytes/second number. (Be aware that on a general open-source mailing list, there's only so much debugging that we can do of a specific probl

Re: Custom logical replication client

2025-05-23 Thread Christophe Pettus
> On May 23, 2025, at 11:36, Edson Carlos Ericksson Richter > wrote: > > Dear Community, > I'm starting a project where I would like to write an application to decode > the logical replication protocol to save data into an analytics streaming > system. > Is there a starting guide or similar pr

<    1   2   3   4