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

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-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: 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: [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: [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: 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: [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: 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: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: 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: 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-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: 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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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 08:51, Subhash Udata wrote: > However, my concern lies in the fact that we are working with production > servers, where downtime is not acceptable. There is no way to upgrade community PostgreSQL, either to a new minor version or a new major version, with absolute zero

Re: Can we directly upgrade postgresql from 13 to 15.4

2024-11-08 Thread Christophe Pettus
> On Nov 8, 2024, at 10:12, jayesh thakare wrote: > Can we upgrade postresql from 13 to 15.4 directly? > Can we upgrade postgresql from 13 to 16 directly? Yes. > Ideally how many major version can we jump to from older version ? There's no practical limit, assuming the old version is not an

Re: Setting "ucs_basic" as the default database collation

2024-10-27 Thread Christophe Pettus
> On Oct 27, 2024, at 13:56, Ron Johnson wrote: > > The CREATE DATABASE statement has an ENCODING option. Does that work with > 'ucs_basic'? No: xof=# create database test encoding=ucs_basic; ERROR: ucs_basic is not a valid encoding name LINE 1: create database test encoding=ucs_basic;

Setting "ucs_basic" as the default database collation

2024-10-27 Thread Christophe Pettus
Is there a way to specify "ucs_basic" (or the other "standard collations" [1]) collation as the default database collation at database creation time, rather than on a per-column or per-operation basis? [1] https://www.postgresql.org/docs/current/collation.html#COLLATION-MANAGING-STANDARD

Re: What are best practices wrt passwords?

2024-10-16 Thread Christophe Pettus
> On Oct 16, 2024, at 09:47, Tom Lane wrote: > I believe it depends on your platform --- some BSDen are pretty > permissive about this, if memory serves. On a Linux box it seems > to work for processes owned by yourself even if you're not superuser. I just tried it on an (admittedly kind of o

Re: Advice on efficiently logging outputs to PostgreSQL

2024-10-15 Thread Christophe Pettus
> On Oct 15, 2024, at 07:17, Dominique Devienne wrote: > Am I worrying too much? :) Probably. :-) The main things I'd worry about is: 1. What's the ratio of log lines to database updates? You want this to be as high as usefully possible, since in effect you are doing write amplification by

Re: PGBouncer - Load balancing options

2024-10-11 Thread Christophe Pettus
Hello, > On Oct 10, 2024, at 03:02, Ravi Varma Addala wrote: > > Hello Team,I wanted to reach out to provide some insight into a request from > my customer regarding their multiple PostgreSQL Flex instances with > PGbouncer. Currently, they are utilizing an Azure Load Balancer which > distrib

Re: Question on indexes

2024-10-10 Thread Christophe Pettus
> On Oct 10, 2024, at 11:49, sud wrote: > > Hi, > I have never used any 'hash index' but saw documents in the past suggesting > issues around hash index , like WAL doesnt generate for "hash index" which > means we can't get the hash index back after crash also they are not applied > to repl

Re: Error Building Postgres 17.0 from Source

2024-10-04 Thread Christophe Pettus
> On Oct 4, 2024, at 12:34, Tom Lane wrote: > > If so, the difference is that up to v16 we > included prebuilt HTML docs in the tarballs, but as of v17 we don't. > So "make world" now triggers a local docs build where before it > didn't. Ah! That would be it.

Re: Error Building Postgres 17.0 from Source

2024-10-04 Thread Christophe Pettus
> On Oct 4, 2024, at 12:05, Tom Lane wrote: > > Yeah, that's what it looks like. I'm a bit confused though because > 16.x should have failed the same way: building our docs without local > DTDs has failed for well over a year now [1]. To add confusion to the fire, I was successfully buildin

Re: Error Building Postgres 17.0 from Source

2024-10-04 Thread Christophe Pettus
> On Oct 4, 2024, at 09:35, Corbin Cavolt wrote: > > Hi, > > I'm having a problem building Postgres 17.0 from source. I'm able to build > all the 16.x versions just fine; I'm running into an error specifically with > version 17.0. I use a devcontainer for development with my own postgres >

Re: Regarding use of single column as primary key on partitioned table

2024-09-27 Thread Christophe Pettus
> On Sep 27, 2024, at 21:25, Durgamahesh Manne > wrote: > > Can't we use primary key on singal column(betid) on partitioned table rather > than using composite key (placedon,betid)? No. Any unique constraint on a partitioned table must include the partition key, including a primary key co

Re: Repeatable Read Isolation Level "transaction start time"

2024-09-25 Thread Christophe Pettus
> On Sep 25, 2024, at 13:49, Greg Sabino Mullane wrote: > BEGIN ISOLATION MODE REPEATABLE READ SNAPSHOT NOW; This might well be a failure of imagination on my part, but when would it pragmatically matter that the snapshot is taken at the first statement as opposed to at BEGIN?

Re: PgBackRest and WAL archive expiry

2024-09-19 Thread Christophe Pettus
> On Sep 19, 2024, at 22:46, KK CHN wrote: > > 1. In the EPAS serverI have postgres.conf with > archive_command = 'pgbackrest --stanza=EMI_Repo archive-push %p && cp %p > /data/archive/%f' > > The problem is that the /data/archive folder is growing within a few days > to 850GB

Re: CREATE DATABASE command concurrency

2024-09-18 Thread Christophe Pettus
> On Sep 17, 2024, at 14:52, Wizard Brony wrote: > > What are the concurrency guarantees of the CREATE DATABASE command? For > example, is the CREATE DATABASE command safe to be called concurrently such > that one command succeeds and the other reliably fails without corruption? The concern

Re: IO related waits

2024-09-16 Thread Christophe Pettus
> On Sep 16, 2024, at 13:24, veem v wrote: > Architecture team is suggesting to enable asynch io if possible, so that the > streaming client will not wait for the commit confirmation from the database. > So I want to understand , how asynch io can be enabled and if any downsides > of doing t

Re: Effects of REVOKE SELECT ON ALL TABLES IN SCHEMA pg_catalog FROM PUBLIC

2024-09-12 Thread Christophe Pettus
> On Sep 12, 2024, at 06:58, Greg Sabino Mullane wrote: > > But if it works for you, go ahead. As Tom said, it will work 95% of the time. > But it will break things that should work, and it will not prevent the > ability to get the information in other ways. To be clear, we never recommend

Re: Overlapping values (?) in multi-column partitioned tables

2024-09-10 Thread Christophe Pettus
> On Sep 10, 2024, at 16:02, David Rowley wrote: > > (it seems strange to always have MINVALUE and MAXVALUE as the range. > I'm guessing that was just an example.) Correct.

Re: Overlapping values (?) in multi-column partitioned tables

2024-09-10 Thread Christophe Pettus
> On Sep 10, 2024, at 15:57, Laurenz Albe wrote: > So the upper limit of the first partition is strictly bigger than the lower > end > of the second partition. > > "record" types have the same lexicographical sorting order as ORDER BY > clauses. Ah, OK, got it. I was thinking of them as a

Re: Overlapping values (?) in multi-column partitioned tables

2024-09-10 Thread Christophe Pettus
gt; by range (ts, pk); >> CREATE TABLE >> xof=# create table t1 partition of t for values from >> ('2024-01-01'::timestamp, minvalue) to ('2024-01-31'::timestamp, maxvalue); >> CREATE TABLE >> xof=# create table t2 partition of t for values from

Overlapping values (?) in multi-column partitioned tables

2024-09-10 Thread Christophe Pettus
Hi, I am clearly not understanding something. Consider: > xof=# create table t (pk bigint not null, ts timestamp not null) partition by > range (ts, pk); > CREATE TABLE > xof=# create table t1 partition of t for values from > ('2024-01-01'::timestamp, minvalue) to ('2024-02-01'::timestamp, max

Re: Foreign Data Wrappers

2024-09-06 Thread Christophe Pettus
> On Sep 6, 2024, at 17:55, Gus Spier wrote: > If I understand the concepts correctly, FDW not only makes other databases > available, FDW also offers access to .csv files, plain text, or just about > anything that can be bullied into some kind of query-able order. There two parts to FDWs: T

Re: Soluton on Lock:extend issue

2024-08-10 Thread Christophe Pettus
> On Aug 10, 2024, at 09:52, Durgamahesh Manne > wrote: > Lock:extend (version 14.11) PostgreSQL version 16 contains improvements that significantly reduce the amount of contention on extend locks; upgrading will almost certainly help.

Re: Vacuum full connection exhaustion

2024-08-08 Thread Christophe Pettus
> On Aug 8, 2024, at 21:15, Ron Johnson wrote: > > "I see a lock, so let's cause another one!" That's crazy. It's more "Oh, look, I need a connection to service this web request, but my pool is empty, so I'll just fire up a new connection to the server," lather, rinse, repeat. Pretty comm

Re: Vacuum full connection exhaustion

2024-08-08 Thread Christophe Pettus
> On Aug 7, 2024, at 10:34, Costa Alexoglou wrote: > > Hey folks, > > I noticed something weird, and not sure if this is the expected behaviour or > not in PostgreSQL. > > So I am running Benchbase (a benchmark framework) with 50 terminals (50 > concurrent connections). > There are 2-3 add

Re: ANALYZE on partitioned tables vs on individual partitions

2024-08-06 Thread Christophe Pettus
> On Aug 6, 2024, at 21:13, Michael Harris wrote: > > 1. What is the consequence of not having good statistics on partitioned > table level, if you do have good statistics on the partition level? The child partitions are just tables, and all of the same issues that can arise from bad stat

Re: data checksums

2024-08-06 Thread Christophe Pettus
> On Aug 6, 2024, at 19:45, Laurenz Albe wrote: > I am surprised by that. Would you say that most storage systems will happily > give you a > garbage block if there was a hardware problem somewhere? "Most" is hard for me to judge. HDDs can have uncorrected and undetected errors, definitely

Re: data checksums

2024-08-06 Thread Christophe Pettus
> On Aug 6, 2024, at 08:11, bruno vieira da silva wrote: > > so my question is why data checksums aren't enabled by default on pg? At this point, mostly historical reasons. They're also superfluous if your underlying file system or storage hardware does storage-level corruption checks (whi

Re: Semantic cache capability for Postgresql db

2024-07-17 Thread Christophe Pettus
> On Jul 12, 2024, at 06:18, pradeep t wrote: > Shall I use the Postgresql database for a semantic cache like the Redis > semantic cache? If you mean this feature: https://redis.io/docs/latest/integrate/redisvl/user-guide/semantic-caching/ ... there is no direct equivalent in Postg

Re: Qualifying use of separate TABLESPACES (performance/functionality)

2024-07-16 Thread Christophe Pettus
> On Jul 16, 2024, at 21:45, imndl...@gmx.com wrote: > Or, does Postgres expect to be able to access any media however it wants > (i.e., R/w), regardless of the expected access patterns of the data stored > there? Well, yes and no. PostgreSQL will not respond well to having media that is liter

Re: PostgreSQL Active-Active Clustering

2024-07-15 Thread Christophe Pettus
> On Jul 15, 2024, at 12:06, Sarkar, Subhadeep wrote: > > • Does the Community edition of PostgreSQL provide NATIVE active-active high > availability clustering with objectives of scalability, load balancing and > high availability without using any extensions or external components or > u

Re: PostgreSQL Active-Active Clustering

2024-07-15 Thread Christophe Pettus
> On Jul 15, 2024, at 12:06, Sarkar, Subhadeep wrote: > > • Does the Community edition of PostgreSQL provide NATIVE active-active > high availability clustering with objectives of scalability, load balancing > and high availability without using any extensions or external components or >

Re: v16 roles, SET FALSE, INHERIT FALSE, ADMIN FALSE

2024-07-08 Thread Christophe Pettus
> On Jul 8, 2024, at 13:29, Christophe Pettus wrote: > > > >> On Jul 8, 2024, at 13:25, Laurenz Albe wrote: >> I didn't test it, but doesn't that allow the member rule to drop objects >> owned >> be the role it is a member of? > > No

Re: v16 roles, SET FALSE, INHERIT FALSE, ADMIN FALSE

2024-07-08 Thread Christophe Pettus
> On Jul 8, 2024, at 13:25, Laurenz Albe wrote: > I didn't test it, but doesn't that allow the member rule to drop objects owned > be the role it is a member of? No, apparently not.

Re: v16 roles, SET FALSE, INHERIT FALSE, ADMIN FALSE

2024-07-08 Thread Christophe Pettus
> On Jul 8, 2024, at 12:58, David G. Johnston > wrote: > That scenario is allowed but provides no useful in-server behavior. That was my conclusion as well. Thanks!

v16 roles, SET FALSE, INHERIT FALSE, ADMIN FALSE

2024-07-08 Thread Christophe Pettus
Hi, This is more curiosity than anything else. In the v16 role system, is there actually any reason to grant membership in a role to a different role, but with SET FALSE, INHERIT FALSE, and ADMIN FALSE? Does the role granted membership gain any ability it didn't have before in that case?

Re: Description field for tables and views

2024-07-03 Thread Christophe Pettus
> On Jul 3, 2024, at 13:24, Kent Dorfman wrote: > Is it SQL standard or postgres specific? It's not in the SQL standard (at the bottom of each page for each SQL command is a note regarding its relationship with the SQL standard). Other DBMS implement something similar, however.

Can't dump new-style sequences independently from their tables.

2024-07-03 Thread Christophe Pettus
Quick example: xof=# CREATE TABLE t1 (id SERIAL PRIMARY KEY); CREATE TABLE xof=# CREATE TABLE t2 (id INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY); CREATE TABLE xof=# \d+ List of relations Schema | Name| Type | Owner | Persistence | Access meth

Re: Description field for tables and views

2024-07-03 Thread Christophe Pettus
> On Jul 3, 2024, at 12:28, Kent Dorfman wrote: > > Is there any psql function/command to add a description field to a table or > view definition in the system? Allow me to introduce you to my good friend "COMMENT": https://www.postgresql.org/docs/current/sql-comment.html

Re: Logical replication with temporary tables

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 18:16, Stuart Campbell > wrote: > > My understanding was that under the hood, AWS uses the logical replication > features that are present in community Postgres. If that's incorrect then I'm > sorry for the off-topic post. Yes, but: The idea of a "degraded" replication

Re: Logical replication with temporary tables

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 17:47, Stuart Campbell > wrote: > My question is whether there is some workaround that will let me create > indexes on a temporary table, and also let me drop the temporary table, in a > way that doesn't end up "degrading" replication? (Presumably that means > avoiding

Re: Accommodating alternative column values

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 15:11, Rich Shepard wrote: > This data set is the > only one I've encountered that has a very few multiple email addresses for a > person. That's pretty common out in the world. Just pulling a small dataset I have available, 4+ email addresses per customer happen frequen

Re: Accommodating alternative column values

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 14:57, Rich Shepard wrote: > Using text rather than varchar() is a good suggestion. To be clear, I wasn't suggesting stuffing them all into a text column with a delimiter, but storing them in a text *array* field, each email address one component of the array.

Re: Accommodating alternative column values

2024-07-02 Thread Christophe Pettus
> On Jul 2, 2024, at 14:47, Rich Shepard wrote: > Is there a way > to accommodate multiple email addresses other than entering both with a > forward slash separating them in the varchar(64) email address column? If you are absolutely 100% sure there will never be any metadata associated with

Re: Gaps in PK sequence numbers [RESOLVED]

2024-06-10 Thread Christophe Pettus
> On Jun 10, 2024, at 18:10, Rich Shepard wrote: > Thanks, Christophe. Is there a way to reset the sequence to the maximum > number +1? I don't recall seeing this in the postgres docs but will look > again. The sequence functions are documented here: https://www.postgresql.org/docs/cu

Re: Gaps in PK sequence numbers

2024-06-10 Thread Christophe Pettus
> On Jun 10, 2024, at 15:57, Rich Shepard wrote: > When I tried inserting new rows in the companies table psql told me that PK > value 2310 already existed. Selecting max(PK) returned 2341. When entering > multiple new rows is there a way to ignore gaps? Strictly speaking, the sequence underly

Re: pg_dump and not MVCC-safe commands

2024-05-20 Thread Christophe Pettus
> On May 20, 2024, at 08:49, PetSerAl wrote: > Basically, you need application cooperation to make > consistent live database backup. If it is critical that you have a completely consistent backup as of a particular point in time, and you are not concerned about restoring to a different proc

Re: Updating 457 rows in a table

2024-05-19 Thread Christophe Pettus
> On May 19, 2024, at 11:30, Rich Shepard wrote: > That's a good idea; I can use a predicate to identify the rows to update. > That would be shorter than a long, comma-separated list. Of course, you can probably also shorten the query to: UPDATE people SET active=true WHERE ... Where

Re: Updating 457 rows in a table

2024-05-19 Thread Christophe Pettus
> On May 19, 2024, at 09:54, Rich Shepard wrote: > > Specifically, in the 'people' table I want to change the column 'active' > from false to true for 457 specific person_id row numbers. UPDATE people SET active=true WHERE id IN (...); The ... can either be an explicit list of the ids, or a

Re: UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
> On May 13, 2024, at 11:26, Adrian Klaver wrote: > May not induce the error unless there are parallel workers involved. Indeed. I'll see about pulling together a test case that forces that.

Re: UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
> On May 13, 2024, at 11:17, Tom Lane wrote: > What's causing that I can't say. It doesn't look like we log the > errno anywhere when failing to read a zone file :-( File descriptor exhaustion? (Of course, that would mean something somewhere is leaking them, which is another problem.)

Re: UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
> On May 13, 2024, at 11:07, Adrian Klaver wrote: > > > What does pg_config --configure show for '--with-system-tzdata' ? It's a local compile, and was built without that. As an experiment, I'm just pounding the server with a single connection doing nothing but SET TIMEZONEs repeatedly. S

Re: UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
> On May 13, 2024, at 10:58, Adrian Klaver wrote: > > You sure the timezone file did not get changed under the connection? Yes (at least, nothing happened on the system that would indicate that). The system wasn't touched during the execution (and, as noted, it worked after as well as befo

Re: UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
> On May 13, 2024, at 10:53, Erik Wienhold wrote: > Can you trigger that error with: > > SET timezone = 'UTC'; No, that works correctly: psql (16.3) Type "help" for help. df=> SET timezone = 'UTC'; SET The error popped up during a long-running connection that had issued that SET many (m

Re: UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
> On May 13, 2024, at 10:48, Adrian Klaver wrote: > Yes: > > https://www.postgresql.org/message-id/5DF49366-10D1-42A4-99BF-F9A7DC3AB0F4%40mailbox.org > > Answer: > > https://www.postgresql.org/message-id/1273542.1712326418%40sss.pgh.pa.us Thanks! Similar, but I don't think it's that. This

UTC is not a time zone?

2024-05-13 Thread Christophe Pettus
PostgreSQL 16.3 on MacOS Sonoma. A long-running process (which held a connection open the entire time) failed with: 2024-05-13 09:12:44.719 PDT,"cyan","cyan",35926,"[local]",664214f9.8c56,3,"SELECT",2024-05-13 06:26:17 PDT,3/60,0,ERROR,22023,"invalid value for parameter ""TimeZone"": ""UT

Re: Question regarding how databases support atomicity

2024-05-03 Thread Christophe Pettus
> On May 3, 2024, at 20:02, Siddharth Jain wrote: > > > The way I understand this is that if there is a failure in-between, we start > undoing and reverting the previous operations one by one. But what if there > is a failure and we are not able to revert an operation. How is that > situat

Re: Performance degradation after upgrading from 9.5 to 14

2024-04-17 Thread Christophe Pettus
> On Apr 17, 2024, at 10:13, Johnathan Tiamoh wrote: > I performed an upgrade from postgresql-9.5 to postgresql-14 and the > performance has degraded drastically. > > Please, is they any advice on getting performance back ? Run: VACUUM (ANALYZE, VERBOSE); More seriously (although

Re: What is referential_action?

2024-04-08 Thread Christophe Pettus
> On Apr 8, 2024, at 06:37, Ron Johnson wrote: > > Four times, the word "referential_action" is used on this page, but it's > never mentioned what the possible referential actions are. They're defined in CREATE TABLE: https://www.postgresql.org/docs/14/sql-createtable.html

Re: how to check if the license is expired.

2024-03-31 Thread Christophe Pettus
> On Mar 31, 2024, at 09:59, Peter J. Holzer wrote: > Is this an acceptable performance penalty per API call? If not, is it > really necessary to check this on every call? Maybe it can be done just > once per session or once per hour. It's probably not required to check it every API call. Two

  1   2   3   4   >