Re: Seq Scan because of stats or because of cast?

2023-03-14 Thread Dominique Devienne
On Mon, Mar 13, 2023 at 2:53 PM Tom Lane wrote: > regards, tom lane > Thank you very much Tom. Very informative.

Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause

2023-03-14 Thread Alban Hertroys
> On 7 Mar 2023, at 4:11, David G. Johnston wrote: > > On Mon, Mar 6, 2023 at 7:51 PM David Rowley wrote: > On Tue, 7 Mar 2023 at 12:40, Tom Lane wrote: > > > > Ben Clements writes: > > > As shown above, the following calculated column can bring in the city > > > name, > > > even though the

Re: Uppercase version of ß desired

2023-03-14 Thread Thorsten Glaser
On Tue, 14 Mar 2023, Celia McInnis wrote: >uc_alphabet = lc_alphabet.replace('ß', 'ẞ').upper() That’s probably for the best. The uppercase Eszett was only added to Unicode under the rule that the lowercase Eszett’s case rules are kept unchanged, and the former’s considered normally only ever type

Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause

2023-03-14 Thread David Rowley
On Tue, 14 Mar 2023 at 21:01, Alban Hertroys wrote: > > On 7 Mar 2023, at 4:11, David G. Johnston > > wrote: > > TOP(city, ROW(population, land_area)) ? > > What should be the expected behaviour on a tie though? Undefined. Same as having an ORDER BY on a column that's not unique. The sort impl

Re: Idea: PostgreSQL equivalent to Oracle's KEEP clause

2023-03-14 Thread David Rowley
On Tue, 14 Mar 2023 at 16:07, Ben Clements wrote: > Similar to your "TOP() and BOTTOM() aggregate" idea, you might find Erwin > Brandstetter's solution using the LAST() aggregate function interesting: > (https://dba.stackexchange.com/a/324646/100880) Interesting. Just note that ORDER BY aggreg

Re: Uppercase version of ß desired

2023-03-14 Thread Philip Semanchuk
> On Mar 13, 2023, at 5:38 PM, Celia McInnis wrote: > > HI: > > I would be really happy if postgresql had an upper case version of the ß > german character. The wiki page > https://en.wikipedia.org/wiki/%C3%9F > > indicates that the capital (U+1E9E ẞ LATIN CAPITAL LETTER SHARP S) was > e

Re: Uppercase version of ß desired

2023-03-14 Thread Kip Cole
The relevant Unicode reference is https://unicode.org/faq/casemap_charprop.html#11 Which basically says that since Unicode 5.0 (its now at Unicode 15.0) stability is guaranteed and the upper-casing to (U+1E9E ẞ LATIN CAPITAL LETTER SHARP S) is optional. > On 14 Mar 2023, at 9:12 pm, Philip S

Re: Uppercase version of ß desired

2023-03-14 Thread Celia McInnis
Thanks Philip. Certainly interesting, As long as postgresql and python return something different for upper and lower case versions of these letters and python indexing of the string picks out the characters "properly" then it might not require a python fix for me. What a can of worms! But at lea

Re: Seq Scan because of stats or because of cast?

2023-03-14 Thread Dominique Devienne
On Mon, Mar 13, 2023 at 2:53 PM Tom Lane wrote: > > PS: libpq uses unsigned int for Oid. So do OIDs go above 2GB in practice? > > Yes, eventually. > OK, I've added support for native OIDs values (i.e. unsigned int, sizeof(4)) in my libpq wrapper. Tested with binary binding and getting of scalar

Re: Problems connecting to the server

2023-03-14 Thread Adrian Klaver
On 3/14/23 12:23 AM, Arsen Deputat wrote: Good evening, I have recently installed pgAdmin and postgreSQL on my computer (macOS), but now I can't connect to the server because I don't know the password, can you help me? Thank you for your understanding! Use the password you where prompted to s

Issues Scaling Postgres Concurrency

2023-03-14 Thread Harrison Borges
Hello everyone. I’m running into severe performance problems with Postgres as I increase the number of concurrent requests against my backend. I’ve identified that the bottleneck is Postgres, and to simplify the test case, I created an endpoint that only does a count query on a table with ~500k ro

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Adrian Klaver
On 3/13/23 9:24 AM, Harrison Borges wrote: Hello everyone. I’m running into severe performance problems with Postgres as I increase the number of concurrent requests against my backend. I’ve identified that the bottleneck is Postgres, and to simplify the test case, I created an endpoint that

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Alan Hodgson
On Mon, 2023-03-13 at 12:24 -0400, Harrison Borges wrote: > Hello everyone. > > I’m running into severe performance problems with Postgres as I > increase the number of concurrent requests against my backend. I’ve > identified that the bottleneck is Postgres, and to simplify the > test case, I cre

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Laurenz Albe
On Mon, 2023-03-13 at 12:24 -0400, Harrison Borges wrote: > I’m running into severe performance problems with Postgres as I increase the > number > of concurrent requests against my backend. I’ve identified that the > bottleneck is > Postgres, and to simplify the test case, I created an endpoint

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Peter J. Holzer
On 2023-03-14 22:47:43 +0100, Laurenz Albe wrote: > On Mon, 2023-03-13 at 12:24 -0400, Harrison Borges wrote: > > I’m running into severe performance problems with Postgres as I > > increase the number of concurrent requests against my backend. I’ve > > identified that the bottleneck is Postgres, a

Re: Issues Scaling Postgres Concurrency

2023-03-14 Thread Tom Lane
"Peter J. Holzer" writes: > On 2023-03-14 22:47:43 +0100, Laurenz Albe wrote: >> A query that counts the number of rows in a table of half a million >> rows is quite expensive and keeps a CPU core busy for a while >> (provided everything is cached). At some degree of parallelism, your >> CPU is ov

Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-14 Thread Bryn Llewellyn
Section "43.7. Cursors” in the PL/pgSQL chapter of the doc (www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-DECLARATIONS) starts with this: « Rather than executing a whole query at once, it is possible to set up a cursor that encapsulates the query, and then read the query r

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-14 Thread Adrian Klaver
On 3/14/23 17:50, Bryn Llewellyn wrote: Section "43.7. Cursors” in the PL/pgSQL chapter of the doc (www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-DECLARATIONS) starts with this: « Rather than executing a whole query at once, it is possible to set up a cursor that encapsu

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-14 Thread Bryn Llewellyn
> adrian.kla...@aklaver.com wrote: > >> b...@yugabyte.com wrote: >> >> Section "43.7. Cursors” in the PL/pgSQL chapter of the doc >> (www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-DECLARATIONS) >> starts with this: >> « >> Rather than executing a whole query at once, it is

Re: Is the PL/pgSQL refcursor useful in a modern three-tier app?

2023-03-14 Thread Adrian Klaver
On 3/14/23 20:29, Bryn Llewellyn wrote: adrian.kla...@aklaver.com wrote: b...@yugabyte.com wrote: Section "43.7. Cursors” in the PL/pgSQL chapter of the doc (www.postgresql.org/docs/current/plpgsql-cursors.html#PLPGSQL-CURSOR-