Re: Selecting all variations of job title in a list

2025-11-26 Thread Bryan Sayer
I am not very skilled at Postgresql specifically, but when I was doing SQL in another environment I would just do select distinct (or unique) jobtitle usually getting a count of how many times each title occurred. Then I would create a mapping to standardize the the job titles. *Bryan Sayer*

Re: Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key

2025-11-26 Thread Ron Johnson
An old greybeard COBOL programmer would say that a critical *OLTP* table should *only* be accessed via one index (customer_id, sale_id, PK, etc), and there should be as few indices as possible on the table. The DBA would then partition based on that index. Any reports should be run from a separat

Re: Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key

2025-11-26 Thread atma ram
Hi Laurenz, Thank you for your reply. The table size is 1.6TB and not GB. My bad. The queries using primary key or partition key will be definitely improved. My question is 20 queries that do not use partition key and use only index. Since this is a critical OLTP system, even if there is a sligh

Re: Selecting all variations of job title in a list

2025-11-26 Thread Rich Shepard
On Wed, 26 Nov 2025, David G. Johnston wrote: I was using this tool a while back when I was doing heavy regex work. https://www.regexbuddy.com/ Keep in mind the native flavor of regex in PostgreSQL is TCL, not Perl. But I’d still say regexp is not the best solution here - unless you encapsula

Re: Selecting all variations of job title in a list

2025-11-26 Thread Rich Shepard
On Wed, 26 Nov 2025, Vincent Veyron wrote: https://perldoc.perl.org/perlre Read the first few pages and you'll be good to go. Thanks, Vincent. Rich

Re: Selecting all variations of job title in a list

2025-11-26 Thread David G. Johnston
On Wednesday, November 26, 2025, Vincent Veyron wrote: > On Wed, 26 Nov 2025 07:10:16 -0800 (PST) > Rich Shepard wrote: > > > > > Learning postgres regexp is at the top of my list. > > > > https://perldoc.perl.org/perlre > > Read the first few pages and you'll be good to go. > I was using this

Re: Selecting all variations of job title in a list

2025-11-26 Thread Vincent Veyron
On Wed, 26 Nov 2025 07:10:16 -0800 (PST) Rich Shepard wrote: > > Learning postgres regexp is at the top of my list. > https://perldoc.perl.org/perlre Read the first few pages and you'll be good to go. -- Bien à vous, Vincent Veyron https://marica.f

Re: Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key

2025-11-26 Thread Laurenz Albe
On Wed, 2025-11-26 at 18:50 +0530, atma ram wrote: > We have a table that is approximately 1.6 GB in size. Query performance has > started to degrade. > Although we have multiple indexes, the large table size is still causing > performance issues. 1.6 GB is too small for partitioning. > We are

Re: Selecting all variations of job title in a list

2025-11-26 Thread Rich Shepard
On Wed, 26 Nov 2025, Vincent Veyron wrote: As Ron wrote, a regexp would do it, I guess? SELECT * FROM people WHERE title ~ 'Asst Gen Mgr|Env Mgr|Gen Mgr|Mgr|Plant Mgr'; Although in your example, you would get the same result with just: SELECT * FROM people WHERE title ~ 'Mgr'; https://www.po

Re: Selecting all variations of job title in a list

2025-11-26 Thread Vincent Veyron
On Tue, 25 Nov 2025 08:33:07 -0800 (PST) Rich Shepard wrote: > Companies can have slightly different titles for the same job; for example > (using abbreviations). 'Asst Gen Mgr.', 'Env Mgr,', 'Gen Mgr,'. 'Mgr,', > 'Plant Mgr.' > > I want to select all people table rows that contain these varieti

Re: Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key

2025-11-26 Thread Ron Johnson
On Wed, Nov 26, 2025 at 8:32 AM atma ram wrote: > Hi, > > Question on PostgreSQL Table Partitioning – Performance of Queries That Do > Not Use the Partition Key > > We have a table that is approximately 1.6 GB in size. Query performance > has started to degrade. Although we have multiple indexes,

Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key

2025-11-26 Thread atma ram
Hi, Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key We have a table that is approximately 1.6 GB in size. Query performance has started to degrade. Although we have multiple indexes, the large table size is still causing performance issues. We

Re: Indentation in a patch

2025-11-26 Thread Peter Eisentraut
On 25.11.25 19:58, Daniel Gustafsson wrote: On 25 Nov 2025, at 19:14, Bernice Southey wrote: .. for my first ever patch attempt. Awesome, we love to see new contributors! I'm tempted to submit my patch without indenting the if-block, and an explanation. That's perfectly fine, an incorre

Re: DROP ROLE blocked by pg_init_privs

2025-11-26 Thread immerrr again
On Wed, Nov 26, 2025 at 4:45 AM Tom Lane wrote: > immerrr again writes: > > On Wed, Nov 26, 2025 at 1:08 AM Tom Lane wrote: > >> The missing step here is > >> DROP OWNED BY test_role; > > > It just makes me uneasy to run a command with such potential for data > loss > > in order to remove a rol