Re: Exclusion constraint with negated operator?

2023-06-13 Thread Tom Lane
=?UTF-8?Q?Torsten_F=C3=B6rtsch?= writes: > My question is can I somehow express something like > EXCLUDE (c1 WITH =, c2 with NOT =) > It seems that's not possible at the moment. But is there any obstacle in > principle or is it just not implemented? Well, it'd likely be a bad idea. Indexes are m

Helping planner to chose sequential scan when it improves performance

2023-06-13 Thread Patrick O'Toole
Hi all, I recently started at a new firm and have been trying to help to grok certain planner behavior. A strip-down example of the sort of join we do in the database looks like this, wherein we join two tables that have about 1 million rows: -- VACUUM (FULL, VERBOSE, ANALYZE), run the query twic

Exclusion constraint with negated operator?

2023-06-13 Thread Torsten Förtsch
Hi, I wanted to create an exclusion constraint like EXCLUDE (c1 WITH =, c2 with <>) This gives an error: operator <>(integer,integer) is not a member of operator family "integer_ops" I can resolve that by using gist and the btree_gist extension. My question is can I somehow express something

Re: Reproducing incorrect order with order by in a subquery

2023-06-13 Thread David G. Johnston
On Tue, Jun 13, 2023 at 10:55 AM Ruslan Zakirov wrote: > Thanks for replying. Maybe I'm just wrong in my assumption. A user reports > incorrect order in the following query: > > SELECT main.*, COUNT(main.id) OVER() AS search_builder_count_all FROM ( > SELECT DISTINCT main.* FROM Tickets main >

Re: Reproducing incorrect order with order by in a subquery

2023-06-13 Thread Ruslan Zakirov
On Tue, Jun 13, 2023 at 6:06 PM Tom Lane wrote: > Ruslan Zakirov writes: > > I know how to fix the problem and I know that ORDER BY should be in the > > outermost select. > > > However, I want to write a test case that shows that the old code is > wrong, > > but can not create > > minimal set of

Re: "paths" between two ROLEs

2023-06-13 Thread Dominique Devienne
On Tue, Jun 13, 2023 at 2:20 PM Joe Conway wrote: > On 6/13/23 04:17, Dominique Devienne wrote: > > To troubleshoot and validate that emulation, I'd like to introspect ROLE > > membership to: > > > > 1) Output the ROLE "path(s)" between any two ROLEs.[...] > > 2) Output all target ROLEs [...] a g

Re: Reproducing incorrect order with order by in a subquery

2023-06-13 Thread Tom Lane
Ruslan Zakirov writes: > I know how to fix the problem and I know that ORDER BY should be in the > outermost select. > However, I want to write a test case that shows that the old code is wrong, > but can not create > minimal set of tables to reproduce it. With this I'm looking for help. The ORD

Re: Reproducing incorrect order with order by in a subquery

2023-06-13 Thread Ruslan Zakirov
On Tue, Jun 13, 2023 at 1:26 PM Thomas Kellerer wrote: > Ruslan Zakirov schrieb am 13.06.2023 um 09:49: > > For example I have a query: > > > > SELECT main.*, count(*) OVER () FROM (SELECT DISTINCT ... ORDER BY X) > > main; > > > > So the `ORDER BY` clause ended up in a subquery. Most of the time

Re: SOC II Type 2 report.

2023-06-13 Thread Christophe Pettus
Hi, > On Jun 12, 2023, at 11:57, Raj Kiran wrote: > Prokopto is completing our annual vendor review process. Please share your > most recent SOC II Type 2 report. The PostgreSQL project isn't SOC2 certified, and will almost certainly never be. If you require SOC2 compliance, you'll need to wo

Re: [Beginner Question] Will the backup wal file take too much storage space?

2023-06-13 Thread Ron
On 6/13/23 06:34, Francisco Olarte wrote: [snip] But if you want to restore to ANY point in time you would need a copy of the initial state of the database and ALL the wal files. Normally you do not want to do this, at most you want to restore to "any point in the last 3 days", in which case you

Re: "paths" between two ROLEs

2023-06-13 Thread Joe Conway
On 6/13/23 04:17, Dominique Devienne wrote: Hi. We emulated a legacy security model (enforced in C/C++ code) into "layers" of PostgreSQL ROLEs and GRANTs, thus enforced database-side. To troubleshoot and validate that emulation, I'd like to introspect ROLE membership to: 1) Output the ROLE "p

Re: [Beginner Question] Will the backup wal file take too much storage space?

2023-06-13 Thread Francisco Olarte
On Tue, 13 Jun 2023 at 10:01, Wen Yi <896634...@qq.com> wrote: > As you can see, base on the wal, we can restore the database to any check > point, but sometimes, If we insert a large column to the postgres (Up to 1 > GB), the postgres will also create a 1 GB wal to store it. You normally restor

Re: Reproducing incorrect order with order by in a subquery

2023-06-13 Thread Thomas Kellerer
Ruslan Zakirov schrieb am 13.06.2023 um 09:49: > For example I have a query: > > SELECT main.*, count(*) OVER () FROM (SELECT DISTINCT ... ORDER BY X) > main; > > So the `ORDER BY` clause ended up in a subquery. Most of the time > ordering works until it doesn't. > > Can you help me create a set of

Re: pg_upgrade v15 not generating analyze_new_cluster.sh

2023-06-13 Thread rihad
On 6/13/23 12:57, Magnus Hagander wrote: On Tue, Jun 13, 2023 at 10:35 AM rihad wrote: Hi, all. When pg_upgrading from PG 11 to 13, a file analyze_new_cluster.sh was generated in the current directory which ran vacuumdb --all --analyze-in-stages When upgrading from 13 to 15.3 no such file was

Re: Dynamic binding issue

2023-06-13 Thread Lorusso Domenico
Because the function is general and should do the same thing for many different table. Unique constraint, each table must have a field with a specific type Il mar 13 giu 2023, 01:31 Adrian Klaver ha scritto: > On 6/12/23 15:13, Lorusso Domenico wrote: > > Hello guys, > > I'm a problem with dynam

Re: pg_upgrade v15 not generating analyze_new_cluster.sh

2023-06-13 Thread Magnus Hagander
On Tue, Jun 13, 2023 at 10:35 AM rihad wrote: > > Hi, all. When pg_upgrading from PG 11 to 13, a file analyze_new_cluster.sh > was generated in the current directory which ran vacuumdb --all > --analyze-in-stages > > When upgrading from 13 to 15.3 no such file was generated, which made me > bel

pg_upgrade v15 not generating analyze_new_cluster.sh

2023-06-13 Thread rihad
Hi, all. When pg_upgrading from PG 11 to 13, a file analyze_new_cluster.sh was generated in the current directory which ran vacuumdb --all --analyze-in-stages When upgrading from 13 to 15.3 no such file was generated, which made me believe it was no longer necessary. Alas, it wasn't the case.

pg_upgrade v15 not generating analyze_new_cluster.sh

2023-06-13 Thread rihad
Hi, all. When pg_upgrading from PG 11 to 13, a file analyze_new_cluster.sh was generated in the current directory which ran vacuumdb --all --analyze-in-stages When upgrading from 13 to 15.3 no such file was generated, which made me believe it was no longer necessary. Alas, it wasn't the case.

"paths" between two ROLEs

2023-06-13 Thread Dominique Devienne
Hi. We emulated a legacy security model (enforced in C/C++ code) into "layers" of PostgreSQL ROLEs and GRANTs, thus enforced database-side. To troubleshoot and validate that emulation, I'd like to introspect ROLE membership to: 1) Output the ROLE "path(s)" between any two ROLEs. Typically between

[Beginner Question] Will the backup wal file take too much storage space?

2023-06-13 Thread Wen Yi
Hi community, When I learn the wal log, a question confuse me. As you can see, base on the wal, we can restore the database to any check point, but sometimes, If we insert a large column to the postgres (Up to 1 GB), the postgres will also create a 1 GB wal to store it. In this situation, will th

Reproducing incorrect order with order by in a subquery

2023-06-13 Thread Ruslan Zakirov
Hello, For example I have a query: SELECT main.*, count(*) OVER () FROM (SELECT DISTINCT ... ORDER BY X) main; So the `ORDER BY` clause ended up in a subquery. Most of the time ordering works until it doesn't. Can you help me create a set of test tables with some data to reproduce this problem

SOC II Type 2 report.

2023-06-13 Thread Raj Kiran
HI , To whom it may concern, Prokopto is completing our annual vendor review process. Please share your most recent SOC II Type 2 report. Thank you! Regards, Raj Kiran.S