Re: Sorting difference in version 10 vs 13

2021-12-20 Thread Ron
Aurora is sufficiently different from vanilla Postgresql that you need to ask Amazon. On 12/20/21 11:31 PM, Akheel Ahmed wrote: Both are Amazon AWS Aurora instances. 10.x is on intel/amd64. 13.x is on their ARM based graviton. select version();  

Re: Sorting difference in version 10 vs 13

2021-12-20 Thread Akheel Ahmed
Both are Amazon AWS Aurora instances. 10.x is on intel/amd64. 13.x is on their ARM based graviton. select version();    version -  

Re: Sorting difference in version 10 vs 13

2021-12-20 Thread Tom Lane
Akheel Ahmed writes: > in 13.4, order by asc gives underscores higher than other characters. > all the LC parameters are identical across both instances. > Am I missing anything else? OS-level differences, perhaps? https://wiki.postgresql.org/wiki/Locale_data_changes

Sorting difference in version 10 vs 13

2021-12-20 Thread Akheel Ahmed
Hi I have performed logical replication from a 10.18 to 13.4. in 13.4, order by asc gives underscores higher than other characters. all the LC parameters are identical across both instances. Am I missing anything else? Help appreciated. Thanks

Re: Max connections reached without max connections reached

2021-12-20 Thread James Sewell
> Ok it is possible, I've got a C extension up and running which hooks > ExecutorStart, then once for each TX ( I monitor the nesting depth like in > pg_stat_statements, and only attach at the top level) attaches a sub > transaction callback, tracking start subtransaction events and incrementing >

Re: Max connections reached without max connections reached

2021-12-20 Thread James Sewell
> > > I'm guessing this won't be back-patched? Is it possible to somehow read > this information from a C function? > > Ok it is possible, I've got a C extension up and running which hooks ExecutorStart, then once for each TX ( I monitor the nesting depth like in pg_stat_statements, and only

Re: How best to turn select result into options like 'a|b|c''

2021-12-20 Thread David G. Johnston
On Mon, Dec 20, 2021 at 3:24 PM Ray O'Donnell wrote: > On 20 December 2021 22:10:19 Shaozhong SHI wrote: > >> Is there a way to turn select result into something like 'a|b|c' . >> Regards, >> David >> > > On my phone so hard to reply properly, but if a, b and c are in separate > rows then you

Re: How best to turn select result into options like 'a|b|c''

2021-12-20 Thread Ray O'Donnell
On 20 December 2021 22:10:19 Shaozhong SHI wrote: Is there a way to turn select result into something like 'a|b|c' . Regards, David On my phone so hard to reply properly, but if a, b and c are in separate rows then you need the array_agg() and array_to_string() functions. Ray.

How best to turn select result into options like 'a|b|c''

2021-12-20 Thread Shaozhong SHI
Is there a way to turn select result into something like 'a|b|c' . Regards, David

Re: Freeing transient memory in aggregate functions

2021-12-20 Thread Tom Lane
Matt Magoffin writes: > I’m essentially doing a datumCopy() on every non-null input value. If you're doing that in the aggContext, you definitely need to free the prior one(s). > I was wondering if there is a way to free the previously copied datum, since > I don’t really need it anymore?

Re: PGBouncer logs explanation required

2021-12-20 Thread Peter Eisentraut
On 19.12.21 12:50, Shubham Mittal wrote: 2021-11-25 14:45:45.244 IST [18307] LOG C-0x6ae270: sit/postgres@abcdlogin attempt: db=sit user=postgres tls=no 2021-11-25 14:45:45.299 IST [18307] LOG S-0x6b4f48: sit/postgres@abcd new connection to server (from abcd) 2021-11-25 14:46:17.843 IST [18307]

Freeing transient memory in aggregate functions

2021-12-20 Thread Matt Magoffin
I have a question about trying to keep memory from growing too much in a C aggregate function with pass-by-reference types. I am trying to keep track of a last-seen value in my aggregate state, so I have code roughly doing this: Datum current; MemoryContext aggContext;

Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL

2021-12-20 Thread Pavel Stehule
Hi > I’m still hoping that I might get some pointers to whitepapers or blog > posts that expand on those bullets that I quoted from the PG doc: «Instead > of packages, use schemas to organize your functions into groups.» and > «Since there are no packages, there are no package-level variables

Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL

2021-12-20 Thread Bryn Llewellyn
b...@yugabyte.com wrote: > >> p...@bowt.ie wrote: >> >>> b...@yugabyte.com wrote: >>> >>> Modular design recommends exposing functionality through a purpose oriented >>> interface and hiding all implementation details from the API’s user. A >>>

Re: How to reduce query planning time (10s)

2021-12-20 Thread Tom Lane
iulian dragos writes: > Is there any way to validate the bloated index hypothesis before I invest > too much in this direction? A plain old VACUUM ought to take care of most of the problem. regards, tom lane

Re: How to reduce query planning time (10s)

2021-12-20 Thread Pavel Stehule
po 20. 12. 2021 v 17:50 odesílatel iulian dragos < iulian.dra...@databricks.com> napsal: > Thanks for the suggestion! > > Reading through the docs it looks like this might involve some downtime > (locking writes to the tables whos indexes are being rebuilt) and this is a > running system. I may

Re: How to reduce query planning time (10s)

2021-12-20 Thread iulian dragos
Thanks for the suggestion! Reading through the docs it looks like this might involve some downtime (locking writes to the tables whos indexes are being rebuilt) and this is a running system. I may need some time to setup a database copy and try to reproduce the issue (dev deployment doesn't

Re: Update concurrency

2021-12-20 Thread Tom Lane
[ please keep the list cc'd ] =?utf-8?Q?Sylvain_D=C3=A9ve?= writes: > Indeed I removed the important part here... I was including a function > definition ("create or replace function ...") in the call too. This was > temporary and dirty. After moving the definition of the function to the >

Re: Update concurrency

2021-12-20 Thread Tom Lane
=?utf-8?Q?Sylvain_D=C3=A9ve?= writes: > # JSONB update for a single selected row and column. > # 'column' and 'select_row' are determined with the parameters 'data' and > 'path'. > command = ( > f"""UPDATE MY_TABLE SET """ > f"""{column} = jsonb_merge({column}, %s)

Re: md5 issues Postgres14 on OL7

2021-12-20 Thread Christoph Moench-Tegeder
Hi! ## Michael Mühlbeyer (michael.muehlbe...@trivadis.com): > postgres=# select md5('just a test'); > ERROR: out of memory Active FIPS mode (/proc/sys/crypto/fips_enabled => 1) on the server does produce this behaviour. Regards, Christoph -- Spare Space

Re: Update concurrency

2021-12-20 Thread David G. Johnston
On Monday, December 20, 2021, Sylvain Déve wrote: > > To summarize, how can I allow for multiple updates of the same attributes, > one after another, even when these updates are requested almost at the same > time from independent, uncontrollable client requests? > Most people use an

Update concurrency

2021-12-20 Thread Sylvain Déve
Hello, On a server, I have an API which is called by one or multiple clients. The server can receive, almost at the same time, multiple update instructions for the same PostgreSQL attribute. These requests do not arrive at the exact same time, and I would just like to execute them one after

Reg. static SQL code analysis tool for PostgreSQL

2021-12-20 Thread holistic.dev
Hi everyone! DB-related workflow can rapidly eat up time as the complexity of projects grows. Tracking details and structures gets harder and the risk of missing an issue that could affect architecture or data structure dependencies increases. The result is undermined performance, hours wasted on

Re: How to reduce query planning time (10s)

2021-12-20 Thread Pavel Stehule
Hi po 20. 12. 2021 v 13:31 odesílatel iulian dragos < iulian.dra...@databricks.com> napsal: > Hi, > > I was analyzing the query performance in a certain code path and noticed > that practically all of the query time is spent planning (11s planning, > 200ms execution time). Here is the output of

How to reduce query planning time (10s)

2021-12-20 Thread iulian dragos
Hi, I was analyzing the query performance in a certain code path and noticed that practically all of the query time is spent planning (11s planning, 200ms execution time). Here is the output of EXPLAIN ANALYZE. I tried using a prepared statement with three parameters (run_id, and the two text

Re: Best Strategy for Large Number of Images

2021-12-20 Thread Imre Samu
> ... I have about 2 million images ... > folder structure The "Who's On First" gazetteer with ~ 26M geojson records - using 3-number chunks subfolder structure. "Given a Who's On First ID its (relative) URI can be derived by splitting the ID in to 3-number chunks representing nested

Re: Best Strategy for Large Number of Images

2021-12-20 Thread Andreas Joseph Krogh
På mandag 20. desember 2021 kl. 11:29:57, skrev Estevan Rech < softr...@gmail.com >: How is this folder structure like 10,000 folders? and the backup of it, how long does it take? I recommend using SeaweedFS as blob-store, and store metadata (folder, size,

Re: Best Strategy for Large Number of Images

2021-12-20 Thread Estevan Rech
How is this folder structure like 10,000 folders? and the backup of it, how long does it take?

md5 issues Postgres14 on OL7

2021-12-20 Thread Michael Mühlbeyer
Hi all, we're currently facing a strange behavior with Postgres14.1 on Oracle Linux 7.9 using md5. a basic statement leads to an out-of-memory error: postgres=# select md5('just a test'); ERROR: out of memory Anyone else facing the same issue? It may be related to hardening though disabling