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.

Nested Stored Procedures - ERROR: invalid transaction termination 2D000

2025-03-22 Thread Kevin Stephenson
hen using structured exception handling in nested stored procedures with an autonomous TX workaround (for error logging), results in error 2D000 (see Test 3). Verbose logging shows it to be caused by function _SPI_rollback() at line 400 (16.4) or 399 (17.4) in spi.c. What seems inconsistent

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 Achilleas Mantzios - cloud
E. As I stated, this example is controversial, and as the documentation states, the IMMUTABLE set of functions should not perform database lookups, as in my example. However, the error message is quite obscure to me, and reminds me a disk corruption rather a stability/function/lookup problem. Te

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

2025-03-12 Thread Luca Ferrari
STABLE or > VOLATILE. As I stated, this example is controversial, and as the documentation states, the IMMUTABLE set of functions should not perform database lookups, as in my example. However, the error message is quite obscure to me, and reminds me a disk corruption rather a stability/function/lookup problem. Luca

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

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

2025-03-12 Thread Luca Ferrari
; RETURN return_value; END $CODE$ LANGUAGE plpgsql IMMUTABLE; CREATE INDEX IF NOT EXISTS idx_tt ON tt( f_tt( pk ) ); CREATE INDEX IF NOT EXISTS idx_t ON t( f_t( pk ) ); The last index, created on table t throws the error: ERROR: could not read block 0 in file "base/357283/365810": r

Re: Error on query execution

2025-03-06 Thread Tom Lane
Igor Korot writes: > On Tue, Mar 4, 2025 at 8:37 PM Tom Lane wrote: >> ... but given that you didn't specify any data type, I think the >> parser will fall back to assuming that $1 is the same type as >> "abf_type", whatever that is. Passing data in binary is not at all >> forgiving about gettin

Re: Error on query execution

2025-03-06 Thread Igor Korot
CT * FROM abcatfmt WHERE abf_type = $1::smallint", 1, nullptr, paramValues, paramLengths, paramFormats, 1 ); results in: $1 = L"ERROR: incorrect binary data format in bind parameter 1\n" I am now at a complete loss. How do I fix the code so it will run? Thank you. > > regards, tom lane

Re: Error on query execution

2025-03-05 Thread Igor Korot
Tom, On Tue, Mar 4, 2025, 8:37 PM Tom Lane wrote: > Igor Korot writes: > > binaryIntVal = htonl( (uint32_t) type ); > > paramValues[0] = (char *) &binaryIntVal; > > paramLengths[0] = sizeof( binaryIntVal ); > > paramFormats[0] = 1; > > You're apparently trying to pass this param

Re: Error on query execution

2025-03-05 Thread Igor Korot
Hi, Tom, On Tue, Mar 4, 2025 at 8:37 PM Tom Lane wrote: > > Igor Korot writes: > > binaryIntVal = htonl( (uint32_t) type ); > > paramValues[0] = (char *) &binaryIntVal; > > paramLengths[0] = sizeof( binaryIntVal ); > > paramFormats[0] = 1; > > You're apparently trying to pass thi

Re: Error on query execution

2025-03-04 Thread Tom Lane
Igor Korot writes: > binaryIntVal = htonl( (uint32_t) type ); > paramValues[0] = (char *) &binaryIntVal; > paramLengths[0] = sizeof( binaryIntVal ); > paramFormats[0] = 1; You're apparently trying to pass this parameter as an int4 ... > res = PQexecParams( m_db, "SELECT * FRO

Error on query execution

2025-03-04 Thread Igor Korot
rrorMsg.push_back( L"Error executing query: " + err ); result = 1; } [/code] Running the above I'm getting: [quote] (gdb) p err $1 = L"ERROR: incorrect binary data format in bind parameter 1\n" [/quote] What is wrong and how do I fix it? Thank you.

Re: Error on the query

2025-03-04 Thread Igor Korot
T EXISTS( SELECT 1 FROM >> pg_class c, pg_namespace n WHERE n.oid = c.relnamespace AND c.relname >> = \'abcatc_x\' AND n.nspname = \'public\' ) THEN CREATE UNIQUE INDEX >> \"abcatc_x\" ON \"abcatcol\"(\"abc_tnam\" ASC, \"abc_

Re: Error on the query

2025-03-04 Thread David G. Johnston
EN CREATE UNIQUE INDEX > \"abcatc_x\" ON \"abcatcol\"(\"abc_tnam\" ASC, \"abc_ownr\" ASC, > \"abc_cnam\" ASC); END IF; END;" ); > [/code] > > What am I missing? > “ ERROR: unterminated dollar-quoted string at or near‘ The terminator for your dollar-quoted string. David J.

Re: Error on the query

2025-03-04 Thread Pavel Stehule
\'abcatc_x\' AND n.nspname = \'public\' ) THEN CREATE UNIQUE INDEX > \"abcatc_x\" ON \"abcatcol\"(\"abc_tnam\" ASC, \"abc_ownr\" ASC, > \"abc_cnam\" ASC); END IF; END;" ); > [/code] > > I got: > > [quote] > $

Error on the query

2025-03-04 Thread Igor Korot
"abcatc_x\" ON \"abcatcol\"(\"abc_tnam\" ASC, \"abc_ownr\" ASC, \"abc_cnam\" ASC); END IF; END;" ); [/code] I got: [quote] $4 = L"ERROR: unterminated dollar-quoted string at or near \"$$ BEGIN IF NOT EXISTS( SELECT 1 FROM pg_class c, pg_na

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

2025-03-03 Thread Laurenz Albe
On Mon, 2025-03-03 at 07:14 +0330, me nefcanto wrote: > The point is, that there is already an `on_error ignore` clause there. This > means that > somewhere there is a try/catch per row. If I'm wrong, please let me know. The crucial point that Tom referred to is the "per row". What is a row? Im

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

2025-03-02 Thread Adrian Klaver
On 3/2/25 19:44, me nefcanto wrote: Thank you all for responding. With respect, I don't understand why COPY gets related to ETL. All of the requirements I mentioned above have nothing to do with ETL. We have a table of categories. A hierarchical table. This is a multitenant app. Hundreds of tho

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

2025-03-02 Thread Tom Lane
amp;h=d9f7f5d32 https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=9e2d87011 and a ton of related commits. It's possible that the specific case of unique-index violations could be handled in a similar style. But "catch any error whatever" is simply not going to

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: Please implement a catch-all error handler per row, for COPY

2025-03-02 Thread me nefcanto
Thank you all for responding. With respect, I don't understand why COPY gets related to ETL. All of the requirements I mentioned above have nothing to do with ETL. We have a table of categories. A hierarchical table. This is a multitenant app. Hundreds of thousands of records are in it. We want to

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

2025-03-01 Thread Greg Sabino Mullane
FYI the -bugs thread in question: https://www.postgresql.org/message-id/flat/CAEHBEOBCweDWGNHDaUk4%3D10HG0QXXJJAGXbEnFLMB30M%2BQw%2Bdg%40mail.gmail.com seems to imply the primary blocker was a unique constraint. Cheers, Greg -- Crunchy Data - https://www.crunchydata.com Enterprise Postgres Soft

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

2025-03-01 Thread Adrian Klaver
On 3/1/25 07:18, me nefcanto wrote: Hello All of these scenarios are such that data sanitation is difficult if not possible before doing the bulk operation (copy). I realized that when we specify `on_error ignore` it just handles a handful of errors. I thought this was a bug and sent an ema

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

2025-03-01 Thread David G. Johnston
On Sat, Mar 1, 2025 at 9:20 AM Tom Lane wrote: > me nefcanto writes: > > Can you please provide a row-level catch-all handler for the copy > command? > > Very unlikely to happen. COPY is not intended as a general purpose > ETL mechanism, and we don't want to load it down with features that > wo

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

2025-03-01 Thread Tom Lane
me nefcanto writes: > Can you please provide a row-level catch-all handler for the copy command? Very unlikely to happen. COPY is not intended as a general purpose ETL mechanism, and we don't want to load it down with features that would create substantial performance penalties. Which that woul

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

2025-03-01 Thread me nefcanto
Hello Please consider these scenarios: - I want to create a million fake products, sometimes even 100 million (we're on MariaDB now and we plan to migrate to Postgres). My team uses fake data for performance tests and other use cases. - Another scenario is translations. Even in production, we hav

Re: #XX000: ERROR: tuple concurrently updated

2025-02-24 Thread Tom Lane
Dominique Devienne writes: > But during those "restore" transactions, I must also make role-to-role > grants, > which AFAIK involve adding rows to pg_auth_members. So they are not subject > to the same "no support for concurrent updates in the catalog-manipulation" > you mentioned, as schema-to-ro

Re: #XX000: ERROR: tuple concurrently updated

2025-02-24 Thread Dominique Devienne
On Thu, Feb 20, 2025 at 4:27 PM Tom Lane wrote: > Dominique Devienne writes: > > Error: DDL Error: GRANT USAGE ON SCHEMA "SCH1", "SCH2" TO "SCH2:RO", > > "SCH2:RW", "SCH2:SU": #XX000: ERROR: tuple concurrently updated > > S

Re: #XX000: ERROR: tuple concurrently updated

2025-02-20 Thread Tom Lane
Dominique Devienne writes: > Hi. A tester just tried to restore two custom backups (not official > PostgreSQL ones) concurrently. > ... > The second session completed OK. > But the first session errors out with: > Error: DDL Error: GRANT USAGE ON SCHEMA "SCH1", &qu

Re: #XX000: ERROR: tuple concurrently updated

2025-02-20 Thread Greg Sabino Mullane
Since you are willing to break the all one transaction rule, and if the restores were created via pg_dump, you could use the --section argument to split things up, run the "pre-data" sections serially, and the rest ("data" and "post-data") concurrently. -- Cheers, Greg -- Crunchy Data - https://

Re: #XX000: ERROR: tuple concurrently updated

2025-02-20 Thread Dominique Devienne
On Thu, Feb 20, 2025 at 4:27 PM Tom Lane wrote: > Dominique Devienne writes: > > Hi. A tester just tried to restore two custom backups (not official > > PostgreSQL ones) concurrently. > > ... > > The second session completed OK. > > But the first session errors

#XX000: ERROR: tuple concurrently updated

2025-02-20 Thread Dominique Devienne
ew seconds later, concurrently. The second session completed OK. But the first session errors out with: Error: DDL Error: GRANT USAGE ON SCHEMA "SCH1", "SCH2" TO "SCH2:RO", "SCH2:RW", "SCH2:SU": #XX000: ERROR: tuple concurrently updated Thus I

Re: ERROR: stack depth limit exceeded

2025-02-20 Thread Laurenz Albe
MER *This message and any attachment are confidential and may be privileged or otherwise protected from disclosure and solely for the use of the person(s) or entity to whom it is intended. If you have received this message in error and are not the intended recipient, please notify the sender immediately and

Re: ERROR: stack depth limit exceeded

2025-02-19 Thread Sándor Daku
However, by copying the code between BEGIN and END from the trigger > function, and inserting it into the Query tool and then running this > code there, it should insert a line in the havonkenti_megtakaritasaink > table. > > But here I got the error message mentioned above. Hey! But

Re: ERROR: stack depth limit exceeded

2025-02-19 Thread Csányi Pál
e there, it should insert a line in the havonkenti_megtakaritasaink >> table. >> >> But here I got the error message mentioned above. Hey! But now this >> code snippet ran without any errors! So what happened here? >> >> Thanks for all the advice! >> >&

Re: ERROR: stack depth limit exceeded

2025-02-19 Thread Csányi Pál
a trigger function and a trigger which will run the > > following code, see below. > > Before this trigger would run, I tried this code. > > When running the code I get the following error message: > > ERROR: stack depth limit exceeded HINT: Increase the configuration > >

Re: ERROR: stack depth limit exceeded

2025-02-19 Thread Greg Sabino Mullane
Not related to the main question, but that query could use a little adjustment. Something like: WITH x AS ( select kelt from javaink_forgalma where en_kaptam is true and az_aru_neve = 'nyugdíjam' order by kelt desc limit 2 ) ,y AS (select min(kelt) from x) ,z AS (select max(kelt) from x) INS

Re: ERROR: stack depth limit exceeded

2025-02-19 Thread Laurenz Albe
gt; Before this trigger would run, I tried this code. > When running the code I get the following error message: > ERROR: stack depth limit exceeded HINT: Increase the configuration > parameter "max_stack_depth" (currently 2048kB), after ensuring the > platform's stack depth l

ERROR: stack depth limit exceeded

2025-02-19 Thread Csányi Pál
get the following error message: ERROR: stack depth limit exceeded HINT: Increase the configuration parameter "max_stack_depth" (currently 2048kB), after ensuring the platform's stack depth limit is adequate. Where am I making a mistake, and what can I do to make this code and t

Re: Help in vetting error using "pg_upgrade" - steps for Postgres DB upgrade from Ver 13.X to ver 14.X/15.X and issue with python binaries

2025-01-28 Thread Adrian Klaver
On 1/28/25 08:23, Bharani SV-forum wrote: Team Need your help. We are trying to use existing VM with underlying OS = Amazon Linux 2 (AL2)  along with Pgsql ver 13.X community edn. Trying to upgrade from 13.X to 15.X and had hit the bottleneck for the mandate to have python ver 3.X binaries. We

Help in vetting error using "pg_upgrade" - steps for Postgres DB upgrade from Ver 13.X to ver 14.X/15.X and issue with python binaries

2025-01-28 Thread Bharani SV-forum
l ver 14.x needed python ver 3.x binary On Friday, January 24, 2025 at 02:14:56 PM EST, Adrian Klaver wrote: On 1/24/25 10:01 AM, Bharani SV-forum wrote: > Adrian > Thanks > > This is the exact error which the system admin is facing > > >     postgresql15-contrib

Re: Help in vetting error using "pg_upgrade" - steps for Postgres DB upgrade from Ver 13.X to ver 15.X

2025-01-24 Thread Adrian Klaver
On 1/24/25 10:01 AM, Bharani SV-forum wrote: Adrian Thanks This is the exact error which the system admin is facing  postgresql15-contrib installation on Amazon Linux 2 fails on Python shared lib dependency Which from your post the admin said was due to: "His version is &quo

Re: Help in vetting error using "pg_upgrade" - steps for Postgres DB upgrade from Ver 13.X to ver 15.X

2025-01-24 Thread Bharani SV-forum
AdrianThanks This is the exact error which the system admin is facing  postgresql15-contrib installation on Amazon Linux 2 fails on Python shared lib dependency "https://www.postgresql.org/message-id/CABUevEz_OHR%2BaGU%2B7yuhpfJD%2BeWgC8aHgVRjP5U30kJqu%2B7jmg%40mail.gmail.com";

Re: Help in vetting error using "pg_upgrade" - steps for Postgres DB upgrade from Ver 13.X to ver 15.X

2025-01-24 Thread Adrian Klaver
On 1/24/25 07:50, Bharani SV-forum wrote: Team Need your additional input. VM is based on EC2 OS Version = Amazon Linux 2 Existing DB version = 13.X - Pg Community under EC2 - VM (Same VM) Target DB version = 15.x  - Pg Community under EC2 - VM (Same VM) i will narrate the latest error

Help in vetting error using "pg_upgrade" - steps for Postgres DB upgrade from Ver 13.X to ver 15.X

2025-01-24 Thread Bharani SV-forum
TeamNeed your additional input.VM is based on EC2 OS Version = Amazon Linux 2  Existing DB version = 13.X - Pg Community under EC2 - VM (Same VM)Target DB version = 15.x  - Pg Community under EC2 - VM (Same VM) i will narrate the latest error executing: SELECT pg_catalog.set_config

Re: Postgresql database terminates abruptly with too many open files error

2025-01-19 Thread Peter J. Holzer
On 2025-01-15 11:42:30 +, Sri Mrudula Attili wrote: > The max_connections =200 and max_files_per_process =1000 as you mentioned. > > So should a max_files_per_process =500 helps? > > > I could see from the number of connections to the databaseis not exceeding > 20. But still these 20 are cau

Re: Postgresql database terminates abruptly with too many open files error

2025-01-19 Thread Durgamahesh Manne
-- Forwarded message - From: Sri Mrudula Attili Date: Wed, 15 Jan, 2025, 17:12 Subject: Re: Postgresql database terminates abruptly with too many open files error To: Tom Lane Cc: Hello Tom, The max_connections =200 and max_files_per_process =1000 as you mentioned. So

Re: pgvector extension error

2025-01-17 Thread Tom Lane
"Zacher, Stacy" writes: > We are having issues getting the pgvector extension to work in a database. This: > dbdev=# create extension if not exists vector; > ERROR: type "vector" already exists indicates you've got some type named "vector" in

pgvector extension error

2025-01-17 Thread Zacher, Stacy
11 | f | 1.0| | (1 row) dbdev=# create extension if not exists vector; ERROR: type "vector" already exists dbdev=# drop extension pgvector; ERROR: extension "pgvector" does not exist Works in a different database on the same server: dbdev=# \c dbrag;

Re: Postgresql database terminates abruptly with too many open files error

2025-01-15 Thread Sri Mrudula Attili
Hello Tom, The max_connections =200 and max_files_per_process =1000 as you mentioned. So should a max_files_per_process =500 helps? I could see from the number of connections to the databaseis not exceeding 20. But still these 20 are causing all the damage or using up all the openfiles quot

Re: Postgresql database terminates abruptly with too many open files error

2025-01-14 Thread Tom Lane
Sri Mrudula Attili writes: >  We have a postgresql VDB(virtual database- Delphix) that keeps > terminating due "to too many open files". What do you have max_connections set to, and how many actually-live server processes are there typically? > The number of allowed openfiles at OS level are 6

Re: Postgresql database terminates abruptly with too many open files error

2025-01-14 Thread Ron Johnson
On Tue, Jan 14, 2025 at 7:58 AM Sri Mrudula Attili wrote: > Hello Team, > > We have a postgresql VDB(virtual database- Delphix) that keeps > terminating due "to too many open files". > > Below are few alerts that we could see from the postgresql.log > > > < 2025-01-14 11:37:20.724 GMT >LOG: ou

Re: Postgresql database terminates abruptly with too many open files error

2025-01-14 Thread Frank Lanitz
Hello, Have you checked something like lsof to see open file descriptors to see? Cheers, frank Am 14.01.25 um 13:58 schrieb Sri Mrudula Attili: Hello Team,  We have a postgresql VDB(virtual database- Delphix) that keeps terminating due "to too many open files". Below are few alerts that w

Postgresql database terminates abruptly with too many open files error

2025-01-14 Thread Sri Mrudula Attili
Hello Team,  We have a postgresql VDB(virtual database- Delphix) that keeps terminating due "to too many open files". Below are few alerts that we could see from the postgresql.log < 2025-01-14 11:37:20.724 GMT >LOG:  out of file descriptors: Too many open files in system; release and retry

Re: pgAgent error on Installation

2025-01-14 Thread Daniel Gustafsson
> On 13 Jan 2025, at 20:11, Fakarai, Edgar wrote: > I am encountering a Certification verification error whenever I want to > install pgAgent from stackbuilder on Windows OS. I have attached the > screenshot of the error message. > Thank you. If I take yes it gives me another

Re: recovery error while running any statement

2025-01-09 Thread Ron Johnson
On Thu, Jan 9, 2025 at 12:01 PM yudhi s wrote: > > On Thu, Jan 9, 2025 at 10:21 PM Adrian Klaver > wrote: > >> On 1/9/25 08:42, yudhi s wrote: >> > Hello Experts, >> > It's postgres aurora version 16. While running the ALTER command on >> any >

Re: recovery error while running any statement

2025-01-09 Thread Adrian Klaver
On 1/9/25 09:01, yudhi s wrote: On Thu, Jan 9, 2025 at 10:21 PM Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 1/9/25 08:42, yudhi s wrote: > Hello Experts, > It's postgres aurora version 16. While  running the ALTER command on any >

Re: recovery error while running any statement

2025-01-09 Thread yudhi s
On Thu, Jan 9, 2025 at 10:21 PM Adrian Klaver wrote: > On 1/9/25 08:42, yudhi s wrote: > > Hello Experts, > > It's postgres aurora version 16. While running the ALTER command on any > > object we see an error "/Only RowExclusiveLock or less can be acquired

Re: recovery error while running any statement

2025-01-09 Thread yudhi s
an 9, 2025 at 11:42 AM yudhi s > wrote: > >> Hello Experts, >> It's postgres aurora version 16. While running the ALTER command on any >> object we see an error "*Only RowExclusiveLock or less can be acquired >> on database objects during recovery*&quo

Re: recovery error while running any statement

2025-01-09 Thread Adrian Klaver
On 1/9/25 08:42, yudhi s wrote: Hello Experts, It's postgres aurora version 16. While  running the ALTER command on any object we see an error "/Only RowExclusiveLock or less can be acquired on database objects during recovery/". If I run any DML it gives an error stating &

Re: recovery error while running any statement

2025-01-09 Thread Ron Johnson
On Thu, Jan 9, 2025 at 11:42 AM yudhi s wrote: > Hello Experts, > It's postgres aurora version 16. While running the ALTER command on any > object we see an error "*Only RowExclusiveLock or less can be acquired on > database objects during recovery*". If I ru

  1   2   3   4   5   6   7   8   9   10   >