Re: PgBouncer Prepared Statement ERROR

2025-07-23 Thread Achilleas Mantzios
On 7/18/25 13:52, KK CHN wrote: Hi , I am getting error when using  PgBouncer(1.23.1 ) with Postgres 16  (RedHAT 9.4) 2025-07-18 00:00:00 IST ERROR:  prepared statement "S_243" does not exist 2025-07-18 00:00:03 IST ERROR:  prepared statement "S_205" does not exist 202

Re: PgBouncer Prepared Statement ERROR

2025-07-18 Thread Laurenz Albe
On Fri, 2025-07-18 at 18:22 +0530, KK CHN wrote: > I am getting error when using  PgBouncer(1.23.1 ) with  Postgres 16  (RedHAT > 9.4) > > 2025-07-18 00:00:00 IST ERROR:  prepared statement "S_243" does not exist > 2025-07-18 00:00:03 IST ERROR:  prepared statement &quo

Re: PgBouncer Prepared Statement ERROR

2025-07-18 Thread Greg Sabino Mullane
Make sure max_prepared_statements is set to nonzero in your config. See: https://www.crunchydata.com/blog/prepared-statements-in-transaction-mode-for-pgbouncer Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Software Products & Tech Support

PgBouncer Prepared Statement ERROR

2025-07-18 Thread KK CHN
Hi , I am getting error when using PgBouncer(1.23.1 ) with Postgres 16 (RedHAT 9.4) 2025-07-18 00:00:00 IST ERROR: prepared statement "S_243" does not exist 2025-07-18 00:00:03 IST ERROR: prepared statement "S_205" does not exist 2025-07-18 00:00:03 IST ERROR: prepa

Re: Syntax error needs explanation [RESOLVED]

2025-07-15 Thread Rich Shepard
On Tue, 15 Jul 2025, Laurenz Albe wrote: Apart from that, the subquery seems to be missing a GROUP BY clause. Laurenz, That was added. Thanks, Rich

Re: Syntax error needs explanation [RESOLVED]

2025-07-14 Thread David G. Johnston
On Monday, July 14, 2025, Laurenz Albe wrote: > On Mon, 2025-07-14 at 12:19 -0700, Rich Shepard wrote: > > On Mon, 14 Jul 2025, David G. Johnston wrote: > > > > > The error indicates your script file is at least 127 lines long and you > > > are showing like

Re: Syntax error needs explanation [RESOLVED]

2025-07-14 Thread Laurenz Albe
On Mon, 2025-07-14 at 12:19 -0700, Rich Shepard wrote: > On Mon, 14 Jul 2025, David G. Johnston wrote: > > > The error indicates your script file is at least 127 lines long and you > > are showing like 9...also do you usually name your script files with a > > .txt ext

RE: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-14 Thread Hayato Kuroda (Fujitsu)
Dear Abrahim, > Hi Hayato and Shlok, I confirmed that it is related of Citus, everytrhing > worked > after remove the Citus instalation from the docker image. Thanks for the confirmation. I also feel that the issue is related with Citus. I recommend to report the Citus's community [1] to solve

Re: Syntax error needs explanation [RESOLVED]

2025-07-14 Thread Rich Shepard
On Mon, 14 Jul 2025, David G. Johnston wrote: Yeah, you need both to read up on aggregate queries and correlated subqueries which is typically how one makes uses of exists (it's called a semi-join in this formulation) David, Thanks. I wasn't sure what to read. Not tested, but: select c.ind

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:59 PM Rich Shepard wrote: > > The current version of the script: > > select c.company_nbr, c.company_name, c.industry > from companies as c > where exists ( >select e.company_nbr >from enforcement as e >) > group by c.industry > order by c.industry; > > And

Re: Syntax error needs explanation

2025-07-14 Thread Rich Shepard
On Mon, 14 Jul 2025, Adrian Klaver wrote: That does not matter, that is more for user convenience in figuring out what the files are for. Adrian, Okay. I still have issues with the script. I want a count of companies with regulatory enforcement actions by industry. Since not all regulated co

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
On Mon, Jul 14, 2025 at 12:45 PM Adrian Klaver wrote: > > > > I mistyped the script's extension as .txt rather than .sql. > > That does not matter, that is more for user convenience in figuring out > what the files are for. > > I think all that is being sai

Re: Syntax error needs explanation

2025-07-14 Thread Adrian Klaver
s more for user convenience in figuring out what the files are for. \o test.txt select * from cell_per; Then doing: psql -d production -U postgres -h localhost -p 5432 -f test.sql Null display is "NULL". psql:test.sql:82: ERROR: syntax error at or near "line_id" LINE

Re: Syntax error needs explanation

2025-07-14 Thread Adrian Klaver
c.company_nbr = e.company_nbr   ) group by industry order by industry; When I run it psql reports an error: psql:companies-with-enforcement-actions.txt:127: ERROR:  syntax error at or near "company_nbr" LINE 1: company_nbr |   company_name The above looks like the format 'align

Re: Syntax error needs explanation [RESOLVED]

2025-07-14 Thread Rich Shepard
On Mon, 14 Jul 2025, David G. Johnston wrote: The error indicates your script file is at least 127 lines long and you are showing like 9...also do you usually name your script files with a .txt extension? David J., Agh! No the filename extension is .sql. But I was using the \o psql option to

Re: Syntax error needs explanation

2025-07-14 Thread David G. Johnston
lty_amt) >from e.enforcement >where c.company_nbr = e.company_nbr >) > group by industry > order by industry; > > When I run it psql reports an error: > psql:companies-with-enforcement-actions.txt:127: ERROR: syntax error at > or near "company_nbr&q

Syntax error needs explanation

2025-07-14 Thread Rich Shepard
order by industry; When I run it psql reports an error: psql:companies-with-enforcement-actions.txt:127: ERROR: syntax error at or near "company_nbr" LINE 1: company_nbr | company_name ^ and I'm not seeing the error. What am I missing? TIA, Rich

Re: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-11 Thread abrahim abrahao
Hi Hayato and Shlok, I confirmed that it is related of Citus, everytrhing worked after remove the Citus instalation from the docker image. I did not added stack trace yet on the new instalation. It seems that the present Citus installation was done in an unusual way. I will work to figure out a

RE: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-10 Thread Hayato Kuroda (Fujitsu)
Dear Abrahim > The Citus extension package is installed, but it is not preload on > shared_preload_libraries > and citus extesion is not created. It is possible that a shared library is loaded even if shared_preload is not set and CREATE EXTENSION is not executed. Per my understanding the specif

Re: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-10 Thread abrahim abrahao
Thanks  Hayato and Shlok, The Citus extension package is installed, but it is not preload on shared_preload_libraries and citus extesion is not created.I will create a new container without Citus extension package and adding stack trace ( I think this is the one you're talking about) as soon as

Re: PostgresSQL Setup error

2025-07-10 Thread DINESH NAIR
e to inquire about an issue currently being > experienced with Postgres with one of our external clients. > > When doing the setup and following the steps accordingly with regards to > adding the details for PostgreSQL Unicode ODBC Driver and testing, I run > into an error where it

RE: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-09 Thread Hayato Kuroda (Fujitsu)
Dear Shlok, Abrahim, > Also, I was going to the logs on found: > > > < 2025-07-08 14:57:08.653 UTC psql postgres postgres 172.18.0.94(53414) > SELECT 0 2025-07-08 14:57:07 UTC 1096 686d31c3.448 2025-07-08 > 14:57:08.653 UTC > LOG: Initializing CDC decoder > > This log is not present in Postg

Re: PostgresSQL Setup error

2025-07-09 Thread Adrian Klaver
and following the steps accordingly with regards to adding the details for PostgreSQL Unicode ODBC Driver and testing, I run into an error where it states the below. *note - I was provided with the username and password . "psql: FATAL: password authentication failed" Was that th

Re: PostgresSQL Setup error

2025-07-09 Thread Laurenz Albe
On Wed, 2025-07-09 at 14:06 +, Jordan Adams wrote: > "psql: FATAL: password authentication failed" > > Please advise if assistance can be provided? Possibly. That error will cause an error message in the PostgreSQL server log. Ask your DBA to find that error message a

PostgresSQL Setup error

2025-07-09 Thread Jordan Adams
regards to adding the details for PostgreSQL Unicode ODBC Driver and testing, I run into an error where it states the below. *note - I was provided with the username and password . "psql: FATAL: password authentication failed" Please advise if assistance can be provided? Kind Regar

Re: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-09 Thread Shlok Kyal
On Wed, 9 Jul 2025 at 12:19, Shlok Kyal wrote: > > On Wed, 9 Jul 2025 at 11:43, abrahim abrahao wrote: > > > > I got error “server process was terminated by signal 11: Segmentation > > fault” using pg_create_logical_replication_slot with pgoutput plugin > > par

Re: error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-08 Thread Shlok Kyal
On Wed, 9 Jul 2025 at 11:43, abrahim abrahao wrote: > > I got error “server process was terminated by signal 11: Segmentation fault” > using pg_create_logical_replication_slot with pgoutput plugin parameter and > using test_decoding worked fine, any idea that is wrong? > >

error “server process was terminated by signal 11: Segmentation fault” running pg_create_logical_replication_slot using pgoutput plugin

2025-07-08 Thread abrahim abrahao
I got error “server process was terminated by signal 11: Segmentation fault” using pg_create_logical_replication_slot with pgoutput plugin parameter and using test_decoding worked fine, any idea that is wrong? Note: I am using docker container and I also updated shm-size from 1024mb to 2g and

Re: Logical Replication Memory Allocation Error - "invalid memory alloc request size"

2025-06-17 Thread Masahiko Sawada
On Wed, Jun 11, 2025 at 7:36 PM Hayato Kuroda (Fujitsu) wrote: > > Dear Max, > > > We have rewritten as many of our transactions as possible to avoid using > > temporary tables, and so far, that seems to have resolved the problem. > > Good to know. We try to fix as soon as possible. > I pushed th

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread David G. Johnston
On Mon, Jun 16, 2025, 10:21 Adrian Klaver wrote: > On 6/16/25 09:29, adolfo flores wrote: > > Hello Team, > > > > I hope you can help me with an issue we're experiencing. We have an app > > running on Kubernetes that opens a huge number of connections within a > > couple of seconds. > > > > The d

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Adrian Klaver
On 6/16/25 11:09 AM, David G. Johnston wrote: I am not understanding the above. The connection limit from the database side is going to be the value for max_connections. It is not clear to me what "...  connection limit of 30% of the max_connections setting" is refer

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Marco Torres
You might want to explore pgpool and pgbouncer. Depending in your use case you might want to glue them togeter. On Mon, Jun 16, 2025, 10:39 AM Tom Lane wrote: > adolfo flores writes: > > I hope you can help me with an issue we're experiencing. We have an app > > running on Kubernetes that opens

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Adrian Klaver
On 6/16/25 09:29, adolfo flores wrote: Hello Team, I hope you can help me with an issue we're experiencing. We have an app running on Kubernetes that opens a huge number of connections within a couple of seconds. The database that the app connects to, is configured with a connection limit o

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Richard Welty
a coding error i've seen from inexperienced devs with little database experience is inattentiveness to how the DB connections were being opened. last time i saw this, a smart young dev with no DB background did not understand the cost of opening connections and had on the order of 30 php

Re: Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread Tom Lane
adolfo flores writes: > I hope you can help me with an issue we're experiencing. We have an app > running on Kubernetes that opens a huge number of connections within a > couple of seconds. You need to fix that app to be less unfriendly, or maybe put it behind a connection pooler. > Is it expect

Getting error "too many clients already" despite having a db connection limit set

2025-06-16 Thread adolfo flores
Hello Team, I hope you can help me with an issue we're experiencing. We have an app running on Kubernetes that opens a huge number of connections within a couple of seconds. The database that the app connects to, is configured with a connection limit of 30% of the max_connections setting. Despite

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-16 Thread Rachel Roch
15 Jun 2025, 17:15 by adrian.kla...@aklaver.com: > > It is redundant for fgrep. > Talk about muscle memory !  How many years have I still been typing fgrep -F thinking I was typing grep -F !

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-15 Thread Adrian Klaver
On 6/15/25 08:15, Adrian Klaver wrote: On 6/15/25 01:06, Rachel Roch wrote: 14 Jun 2025, 16:21 by adrian.kla...@aklaver.com: Isn't fgrep -F redundant? As I understand it fgrep = grep -F You have the wrong end of the stick. ;-) Don't think so, the -F is redundant. It is redundant for

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-15 Thread Adrian Klaver
On 6/15/25 01:06, Rachel Roch wrote: 14 Jun 2025, 16:21 by adrian.kla...@aklaver.com: Isn't fgrep -F redundant? As I understand it fgrep = grep -F You have the wrong end of the stick. ;-) Don't think so, the -F is redundant. Try grep -F then fgrep and then fgrep -F on the same file.

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-15 Thread Rachel Roch
14 Jun 2025, 16:21 by adrian.kla...@aklaver.com: > > Isn't fgrep -F redundant? As I understand it fgrep = grep -F > You have the wrong end of the stick. ;-) As per Grep 3.8 release notes (https://lists.gnu.org/archive/html/info-gnu/2022-09/msg1.html): "The egrep and fgrep commands, whic

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-14 Thread Adrian Klaver
bject, its name and the owner. The error message and your first example above show that the command is there. See at here: https://www.postgresql.org/docs/current/app-pgrestore.html in the Examples section how you can comment out the line. Then you could use -L to feed the list back to pg_r

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-14 Thread Rachel Roch
13 Jun 2025, 20:13 by adrian.kla...@aklaver.com: > > To get at an editable script you can do something like: > > pg_restore -f my_database_txt.sql my_database.dump > > This will give you a plain text version of the dump that you can feed back to > psql to load into remote database. > Thanks

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-13 Thread Adrian Klaver
On 6/13/25 11:23, Tom Lane wrote: Rachel Roch writes: This is the error I am seeing: pg_restore: error: could not execute query: ERROR: permission denied to change default privilegesCommand was: ALTER DEFAULT PRIVILEGES FOR ROLE "postgres" IN SCHEMA "public" GRANT

pg_restore ERROR: permission denied to change default privileges

2025-06-13 Thread Rachel Roch
abase > my_database.dump I am attempting to restore it using the proxy admin user provided by the cloud provider: pg_restore -d "host=foobar.example.com port=12345 user=my_cloud_admin_user sslrootcert=/path/to/the/cert.crt sslmode=require dbname=my_database" -O -1  my_database.dump This

Re: pg_restore ERROR: permission denied to change default privileges

2025-06-13 Thread Tom Lane
Rachel Roch writes: > This is the error I am seeing: > pg_restore: error: could not execute query: ERROR: permission denied to > change default privilegesCommand was: ALTER DEFAULT PRIVILEGES FOR ROLE > "postgres" IN SCHEMA "public" GRANT SELECT ON TABLES TO &qu

RE: Logical Replication Memory Allocation Error - "invalid memory alloc request size"

2025-06-11 Thread Hayato Kuroda (Fujitsu)
Dear Max, > We have rewritten as many of our transactions as possible to avoid using > temporary tables, and so far, that seems to have resolved the problem. Good to know. We try to fix as soon as possible. Sorry for inconvenience. Best regards, Hayato Kuroda FUJITSU LIMITED

Re: Logical Replication Memory Allocation Error - "invalid memory alloc request size"

2025-06-11 Thread Max Madden
s with memory allocation errors like: > > > > ``` > > 2025-06-10 14:14:56.800 UTC [299] ERROR: could not receive data from WAL > stream: ERROR: invalid memory alloc request size 1238451248 > > 2025-06-10 14:14:56.805 UTC [1] LOG: background worker "logical > replication worker

RE: Logical Replication Memory Allocation Error - "invalid memory alloc request size"

2025-06-10 Thread Hayato Kuroda (Fujitsu)
6-10 14:14:56.800 UTC [299] ERROR: could not receive data from WAL > stream: ERROR: invalid memory alloc request size 1238451248 > 2025-06-10 14:14:56.805 UTC [1] LOG: background worker "logical replication > worker" (PID 299) exited with exit code 1 > ``` I think this

Logical Replication Memory Allocation Error - "invalid memory alloc request size"

2025-06-10 Thread Max Madden
r all tables. However, anywhere from 5 minutes to 2 hours after the initial sync, the subscription consistently fails with memory allocation errors like: ``` 2025-06-10 14:14:56.800 UTC [299] ERROR: could not receive data from WAL stream: ERROR: invalid memory alloc request size 1238451248 2025-06-

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-10 Thread איתי זרחוביץ
le to > figure out to get it running too. > > The error message you originally shared isn't a Postgres issue but a macOS > issue. > > On Fri, May 9, 2025, at 1:57 PM, איתי זרחוביץ wrote: > > Ok > So, in order to install it well, what are the steps that i need to t

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-10 Thread איתי זרחוביץ
gt; you before I saw), as otherwise the response only goes to me directly and > nobody else can follow along or help you. > > After a quick online search it seems that this error means you don't have > Rosetta installed, this is the emulation layer that Apple provides to run > A

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-08 Thread Philipp Defner
Go to https://postgresapp.com/downloads.html, download the app, install and connect to the running instance with your Postgres GUI client of choice. If it's an important part of your studies you should be able to figure out to get it running too. The error message you originally shared is

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-08 Thread Philipp Defner
Hey, please use "Reply All" when you reply (As someone else already told you before I saw), as otherwise the response only goes to me directly and nobody else can follow along or help you. After a quick online search it seems that this error means you don't have Rosetta install

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669‏

2025-05-08 Thread Philipp Defner
Hey, you'll need to give a bit more information here. How did you install Postgres and what are you doing to see this error message? There's multiple ways recommended on https://www.postgresql.org/download/macosx/, personally I'd give Postgres.app a. try or the installation via

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669

2025-05-08 Thread Adrian Klaver
On 5/8/25 12:41, איתי זרחוביץ wrote: You need to remember to hit Reply All so the list is included in the conversation. Ccing list I tried before a hour to download Try now and see what happens. Also try the postgres.app link I posted previously. -- Adrian Klaver adrian.kla...@aklaver

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669

2025-05-08 Thread Adrian Klaver
On 5/8/25 12:02, איתי זרחוביץ wrote: Reply to list also: Ccing list. I tried to download from this link: https://www.enterprisedb.com/downloads/postgres-postgresql-downloads <https://www.enterprisedb.com/downloads/postgres-postgresql-downloads> and than i got the

Re: Issue Launching PostgreSQL on MacBook M4 – Error -10669

2025-05-08 Thread Adrian Klaver
On 5/8/25 05:17, איתי זרחוביץ wrote: ,Hello I have a MacBook with an M4 chip. I tried installing PostgreSQL version 17.5, but after the installation, I received the following error | _LSOpenURLsWithCompletionHandler() failed with error -10669 (1) .and the application fails to launch A

Re: Error in DROP TABLESPACE

2025-05-07 Thread Laurenz Albe
On Wed, 2025-05-07 at 08:16 +, Fagnani Gabriele G (GDS I&TS) wrote: > INTERNAL ? > I've run into an odd problem - I have what seems to be a "zombie" tablespace > that PostgreSQL won't let me drop, but nothing inside it is active. >   > drop tabl

Error in DROP TABLESPACE

2025-05-07 Thread
INTERNAL Hi, I've run into an odd problem - I have what seems to be a "zombie" tablespace that PostgreSQL won't let me drop, but nothing inside it is active. drop tablespace ts_idx_wb2; ERROR: tablespace "ts_idx_wb2" is not emp

Re: an error message that I don't understand

2025-05-02 Thread David G. Johnston
On Fri, May 2, 2025 at 1:25 PM Martin Mueller < martinmuel...@northwestern.edu> wrote: > > table tid from new index tuple (32586,21) overlaps with invalid duplicate > tuple at offset 120 of block 4398 in index "aacorrections_tcpreading_idx" > Read that as "your index is corrupted". > I have no

an error message that I don't understand

2025-05-02 Thread Martin Mueller
I get this error message: table tid from new index tuple (32586,21) overlaps with invalid duplicate tuple at offset 120 of block 4398 in index "aacorrections_tcpreading_idx" from an update query of the update table 1 set columnx = ‘yes’ where table1.xmlid in (select xmlid from table

Re: SQL ERROR subquery uses ungrouped column in PostgreSQL

2025-04-30 Thread David Rowley
On Thu, 1 May 2025 at 00:29, PALAYRET Jacques wrote: > => In the subquery, the semantic analysis of the query considers the column " > dat " instead of the expression " to_char(dat,'mm') ", which is actually > a grouped column. > Is this normal? How can I simply resolve the problem? Calcula

SQL ERROR subquery uses ungrouped column in PostgreSQL

2025-04-30 Thread PALAYRET Jacques
Hello, I have an unexpected error in my following query (of course, the query has been simplified here to request help): SELECT num_poste, to_char(dat, 'MM')::integer dat, CASE FLOOR((TO_NUMBER(TO_CHAR(dat,'DD'),'99')-1)/10) WHEN 0 THEN 1 WHEN 1 THEN 2 ELSE

Re: Upsert error "column reference is ambiguous"

2025-04-29 Thread David G. Johnston
On Tuesday, April 29, 2025, Tim Starling wrote: > > > This is a public interface and there may be callers in code that I don't > have access to. > You might help your cause by sharing examples of how client code uses your driver to perform upsert that runs into this limitation. David J.

Re: Upsert error "column reference is ambiguous"

2025-04-29 Thread Tom Lane
David Rowley writes: > Another thought is that you can have an UPDATE with a RETURNING > clause. An unqualified column defaults to NEW even though you could > argue it's ambiguous due to OLD (as of 80feb727c). Likely we were > forced into making it work that way through not wanting to force > ever

Re: Upsert error "column reference is ambiguous"

2025-04-29 Thread David Rowley
n a; select * from a1 where a in(select a from a2); -- silently returns unexpected results. If the original author of that query had been thoughtful enough to qualify the column in the subquery then someone would probably have gotten an error and fixed it. The moral of that story is that sometimes f

Re: Upsert error "column reference is ambiguous"

2025-04-29 Thread Tim Starling
On 29/4/25 16:36, Laurenz Albe wrote: On Tue, 2025-04-29 at 08:36 +1000, Tim Starling wrote: My code would be like function upsert( $table, $names, $values, $key, $set ) { if ( $this->type === 'mysql' ) { $conflict = 'ON DUPLICATE KEY UPDATE'; } else { $conflict

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Laurenz Albe
On Tue, 2025-04-29 at 08:36 +1000, Tim Starling wrote: > My code would be like > > function upsert( $table, $names, $values, $key, $set ) { > if ( $this->type === 'mysql' ) { > $conflict = 'ON DUPLICATE KEY UPDATE'; > } else { > $conflict = "ON CONFLICT ($key) DO UPDATE

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 and $values arr

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: Upsert error "column reference is ambiguous"

2025-04-28 Thread Tim Starling
On 28/4/25 23:30, Peter Geoghegan wrote: You can use an alias for the target table name. Is it feasible to require callers to prefix all field names with a generic table name alias? No, primarily because MySQL does not support such an alias. -- Tim Starling

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Tim Starling
On 28/4/25 23:54, Tom Lane wrote: AFAIK, "ON CONFLICT" is a Postgres-ism. Exactly which constructs in exactly which other databases are you citing as precedent? There's a list here: Since that page was written in 201

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread David G. Johnston
On Monday, April 28, 2025, Tom Lane wrote: > > AFAIK, "ON CONFLICT" is a Postgres-ism. Exactly which constructs > in exactly which other databases are you citing as precedent? > I confirmed the SQLite reference from the original email. “The upsert above inserts the new vocabulary word "jovial"

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Tom Lane
Tim Starling writes: > On 28/4/25 20:54, Tom Lane wrote: >> Even if I were on board with arbitrarily adopting one of the two >> possible interpretations, it's far from obvious to me that most people >> would agree that "v" should mean the value from the existing row, >> rather than the new value.

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Peter Geoghegan
On Mon, Apr 28, 2025 at 12:56 AM Tim Starling wrote: > Our application has an upsert method which takes the assignment > "v=v+1" as a string. It is feasible to split it on the equals sign > into the destination field and expression components, but it is not > feasible to parse the expression or to

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Laurenz Albe
On Mon, 2025-04-28 at 21:22 +1000, Tim Starling wrote: > On 28/4/25 20:54, Tom Lane wrote: > > Even if I were on board with arbitrarily adopting one of the two > > possible interpretations, it's far from obvious to me that most people > > would agree that "v" should mean the value from the existing

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Tim Starling
On 28/4/25 20:54, Tom Lane wrote: Even if I were on board with arbitrarily adopting one of the two possible interpretations, it's far from obvious to me that most people would agree that "v" should mean the value from the existing row, rather than the new value. Better to make them say which the

Re: Upsert error "column reference is ambiguous"

2025-04-28 Thread Tom Lane
Tim Starling writes: > Regarding upsert syntax. > => INSERT INTO t VALUES (1,1) ON CONFLICT (k) DO UPDATE SET v=v+1; > ERROR: column reference "v" is ambiguous > Please convince me that this is not a bug. It's not a bug. > If I understand correctly, in the

Re: Upsert error "column reference is ambiguous"

2025-04-27 Thread David G. Johnston
On Sunday, April 27, 2025, Tim Starling wrote: > thus allowing it to DWIM. We intentionally choose (or, in any case have established) a SWYM approach here. Personally I’d be fine with the reduced helpfulness in trying to prevent buggy queries in the interest of being more conforming with the b

Upsert error "column reference is ambiguous"

2025-04-27 Thread Tim Starling
O UPDATE SET v=v+1; ERROR: column reference "v" is ambiguous Please convince me that this is not a bug. If I understand correctly, in the expression "v+1", both EXCLUDED.v and t.v are present as the unqualified name "v". This is always the case and it is never

Re: [EXTERNAL] Re: Why is an error not thrown when the time exceeds the lock timeout for an ExclusiveLock on a transaction ?

2025-04-21 Thread Mansky, Edmund J. (GSFC-671.0)[ADNET Affiliate]
0771 edmund.j.man...@nasa.gov<mailto:edmund.j.man...@nasa.gov> From: Martin Gainty Date: Friday, April 18, 2025 at 11:51 AM To: "Mansky, Edmund J. (GSFC-671.0)[ADNET Affiliate]" , "pgsql-gene...@postgresql.org" Subject: [EXTERNAL] Re: Why is an error not thrown w

Re: Error while updating a table

2025-04-19 Thread Peter J. Holzer
On 2025-04-19 13:06:27 +, sivapostg...@yahoo.com wrote: > Thanks Laurenz, > > it is 100% clear that an earlier statement in the same transaction must > > have got an error. Write your application so that it logs *every* error > > that comes from the database, then you a

Re: Error while updating a table

2025-04-19 Thread David G. Johnston
On Sat, Apr 19, 2025 at 6:06 AM sivapostg...@yahoo.com < sivapostg...@yahoo.com> wrote: > By any chance, if I get that statement, what should I do? > Read it. What are the Steps (or documentation) to correct this issue? > > Impossible to say until the statement is read. David J.

Re: Error while updating a table

2025-04-19 Thread sivapostg...@yahoo.com
Thanks Laurenz, > it is 100% clear that an earlier statement in the same transaction musthave >got an error.  Write your application so that it logs *every* error that comes from the database, then you are sure to catch that error. There is an option to log every sql statement that'

Re: Error while updating a table

2025-04-19 Thread Laurenz Albe
On Sat, 2025-04-19 at 12:38 +, sivapostg...@yahoo.com wrote: > So far, I couldn't find the query that caused the error.   Is there any way > to unlock it?   > > Re-start, Format and fresh install of windows, etc. ? On Windows you have to reboot, bow three times toward sun

Re: Error while updating a table

2025-04-19 Thread sivapostg...@yahoo.com
So far, I couldn't find the query that caused the error.   Is there any way to unlock it?   Re-start, Format and fresh install of windows, etc. ? Happiness Always BKR Sivaprakash On Friday 18 April, 2025 at 04:50:52 pm IST, sivapostg...@yahoo.com wrote: If the query caused an

Re: Why is an error not thrown when the time exceeds the lock timeout for an ExclusiveLock on a transaction ?

2025-04-18 Thread Martin Gainty
#x27; }); async function executeQuery(sql) { const client = await pool.connect(); try { const result = await client.query(sql, { timeout: 5000 }); // Timeout after 5 seconds return result; } catch (err) { console.error('Error executing query:', err); throw err; // Re-throw to propagate

Re: Why is an error not thrown when the time exceeds the lock timeout for an ExclusiveLock on a transaction ?

2025-04-18 Thread Tom Lane
ation "sum_partn_alloc" > The Postgres server (12.22), running on RHEL 8.10 is configured with a > default lock timeout of 1 sec. > Why is Postgres not throwing an error when the ShareLock time has exceeded 1 > sec. ? I think you have misread the description of deadlock_t

Why is an error not thrown when the time exceeds the lock timeout for an ExclusiveLock on a transaction ?

2025-04-18 Thread Mansky, Edmund J. (GSFC-671.0)[ADNET Affiliate]
n be just a single number, or a long list of numbers (20-50 or so). Normally, this SQL is executed without problem thousands of times a day. Then, we see at certain times when that SQL exceeds the timeout for the ShareLock on the transaction. No error is thrown from the DB and processing on t

Re: Error while updating a table

2025-04-18 Thread sivapostg...@yahoo.com
If the query caused an error Does it mean that other reasons might also be there? Nevertheless, I'll check the log file to find the query... Happiness Always BKR Sivaprakash On Friday 18 April, 2025 at 03:53:06 pm IST, Laurenz Albe wrote: On Fri, 2025-04-18 at 07:31

Re: Error while updating a table

2025-04-18 Thread Laurenz Albe
On Fri, 2025-04-18 at 07:31 +, sivapostg...@yahoo.com wrote: > For the second part, how to identify that culprit query? If the query caused an error, and you left "log_min_messages" at the default setting, the error and the statement that caused it should be in the PostgreSQ

Re: Error while updating a table

2025-04-18 Thread sivapostg...@yahoo.com
4+1) on x86_64-pc-linux-gnu, compiled > by gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, 64-bit > > Suddenly, one system starts throwing an error while updating a record from > PowerBuilder. > The same update statement (window) works fine, when run from other computers.  > Error > oc

Re: Error while updating a table

2025-04-17 Thread Laurenz Albe
On Fri, 2025-04-18 at 05:49 +, sivapostg...@yahoo.com wrote: > We use PowerBuilder along with PostgreSQL. > > PostgreSQL 15.7 (Ubuntu 15.7-1.pgdg24.04+1) on x86_64-pc-linux-gnu, compiled > by gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, 64-bit > > Suddenly, one system starts

Re: Error while updating a table

2025-04-17 Thread sivapostg...@yahoo.com
Hello, We use PowerBuilder along with PostgreSQL. PostgreSQL 15.7 (Ubuntu 15.7-1.pgdg24.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 13.2.0-23ubuntu4) 13.2.0, 64-bit Suddenly, one system starts throwing an error while updating a record from PowerBuilder.  The same update statement

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

2025-03-22 Thread Tom Lane
in outer exception handler: %', sqlerrm; With that, the test shows regression=# call outer(); NOTICE: in outer exception handler: invalid transaction termination CALL What is happening is that inner() does PERFORM 1/0, fails and bounces out to its exception handler, and then the ROLLBACK throws an e

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 ROLLB

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

2025-03-22 Thread Tom Lane
Kevin Stephenson writes: > 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 to an aborted s

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

2025-03-22 Thread Kevin Stephenson
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 to an aborted subTX, a real full ROLLBACK, or something else? P

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

2025-03-22 Thread Tom Lane
Christophe Pettus writes: > A procedure cannot issue top-level transaction control statements from within > an exception block, and attempting to do so raises the error you saw. This > includes procedures that are called from within an exception block. Yeah. Postgres doesn't h

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

2025-03-22 Thread Christophe Pettus
exception block, and attempting to do so raises the error you saw. This includes procedures that are called from within an exception block.

  1   2   3   4   5   6   7   8   9   10   >