Why not set builder->next_phase_at=InvalidTransactionId in SnapBuildRestore function?

2022-11-23 Thread zxwsbg
Hi, guys: In PG14 or higher version, I notice that SnapBuildRestore don't set builder->next_phase_at=InvalidTransactionId . But in SnapBuildSerialize function, the assert check this condition. Assert(builder->next_phase_at == InvalidTransactionId); I'd like to know is this right? Thanks

Fwd: Change the auth. postgresql and GIS

2022-11-23 Thread Nikolas Hanry
Dear Community, we tried to change the auth. in our postgresql environment (PostgreSQL V.11) from MD5 to SCRUM SHA 256 - stop the services and killed all active connections - changed with alter and set pw the editor user to sha (psql) - checked if the pw changes successfull (psql and pg4admin) -

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 9:57 PM Tom Lane wrote: > Andres Freund writes: > > I think it'd be easier to deal with this if COMPLETE_WITH_* caused the > the > > containing function to return. Then the completions wouldn't need to be > in one > > huge if-else if. Leaving msvc aside, that also seems n

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 9:32 PM Andres Freund wrote: > Hi, > > On 2022-11-23 20:55:18 -0500, Kirk Wolak wrote: > > Currently I have a lot of it working, but I need to partner up with some > of > > the meson guys... > > if it is already close to working, a couple of my tweaks could accelerate > >

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Tom Lane
Andres Freund writes: > I think it'd be easier to deal with this if COMPLETE_WITH_* caused the the > containing function to return. Then the completions wouldn't need to be in one > huge if-else if. Leaving msvc aside, that also seems nice for efficiency. Yeah, that could be an easy quick-fix. W

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 20:55:18 -0500, Kirk Wolak wrote: > Currently I have a lot of it working, but I need to partner up with some of > the meson guys... > if it is already close to working, a couple of my tweaks could accelerate > it. I just successfully compiled postgres with meson and readline, us

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 20:28:29 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: > >> Huh ... do you recall the details? Large as tab-complete is, it's > >> far smaller than gram.y: > > > So It might just be that we need to split up that very long "else

Re: table inheritance partition and indexes

2022-11-23 Thread David Rowley
On Thu, 24 Nov 2022 at 11:34, Ted Toth wrote: > > On Wed, Nov 23, 2022 at 4:01 PM Tom Lane wrote: >> Then you're stuck managing it manually. But ATTACH PARTITION is >> not relevant to INHERITS-style partitioning. > > That's the part that wasn't clear to me, thanks. Would this have been more cle

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 7:41 PM Andres Freund wrote: > Hi, > > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: > > Andres Freund writes: > > > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > > >> It'd certainly be nice if we could use Readline on Windows. > > So It might just be that we need to sp

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 6:11 PM Tom Lane wrote: > Andres Freund writes: > > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > >> It'd certainly be nice if we could use Readline on Windows. > > > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with > >USE_READLINE defined, d

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-23 18:11:22 -0500, Tom Lane wrote: >> Huh ... do you recall the details? Large as tab-complete is, it's >> far smaller than gram.y: > So It might just be that we need to split up that very long "else if" chain in > psql_completion(). Could be, yeah. Related p

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Andres Freund
Hi, On 2022-11-23 18:11:22 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > >> It'd certainly be nice if we could use Readline on Windows. > > > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with > >USE_READLINE defined,

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Tom Lane
Andres Freund writes: > On 2022-11-21 10:58:06 -0500, Tom Lane wrote: >> It'd certainly be nice if we could use Readline on Windows. > 2) The last time I checked, msvc couldn't preprocess tab-complete.c with >USE_READLINE defined, due to running into some preprocessor limits. We can >prob

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Andres Freund
hi, On 2022-11-21 10:58:06 -0500, Tom Lane wrote: > Kirk Wolak writes: > > We have our team of Windows developers, leveraging PSQL. But honestly, > > it feels crippled after using PSQL in Linux for any length of time. Losing > > auto-complete sucks (multi-line query recall/editing is lost as

Re: table inheritance partition and indexes

2022-11-23 Thread Ted Toth
On Wed, Nov 23, 2022 at 4:01 PM Tom Lane wrote: > Ted Toth writes: > > On Wed, Nov 23, 2022 at 1:24 PM Ron wrote: > >> Out of curiosity, why INHERITS in v13 instead of PARTITION BY? > > > Because none of the declarative partition types do what I want. > > Then you're stuck managing it manually.

Re: table inheritance partition and indexes

2022-11-23 Thread Tom Lane
Ted Toth writes: > On Wed, Nov 23, 2022 at 1:24 PM Ron wrote: >> Out of curiosity, why INHERITS in v13 instead of PARTITION BY? > Because none of the declarative partition types do what I want. Then you're stuck managing it manually. But ATTACH PARTITION is not relevant to INHERITS-style parti

Re: table inheritance partition and indexes

2022-11-23 Thread Ted Toth
Because none of the declarative partition types do what I want. On Wed, Nov 23, 2022 at 1:24 PM Ron wrote: > Out of curiosity, why INHERITS in v13 instead of PARTITION BY? > > On 11/23/22 09:31, Ted Toth wrote: > > I've created a table with a number of indexes and then created a > partition > >

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Kirk Wolak
On Wed, Nov 23, 2022 at 6:56 AM Karsten Hilbert wrote: > Am Tue, Nov 22, 2022 at 11:59:59PM -0500 schrieb Kirk Wolak: > > > > It's OK to post a work-in-progress patch to pgsql-hackers, even if it > > > src/bin/psql/t/010_tab_completion.pl pass on Windows, but if that's > > > hard, don't let that

Re: How to avoid having to run the GRANT command for newly added tables?

2022-11-23 Thread Siddharth Jain
Thanks Christophe. it works. On Wed, Nov 23, 2022 at 12:08 PM Christophe Pettus wrote: > > > > On Nov 23, 2022, at 12:06, Siddharth Jain wrote: > > Is there any way to accomplish what I want? Thanks. > > There is: > > > https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html >

Re: How to avoid having to run the GRANT command for newly added tables?

2022-11-23 Thread Christophe Pettus
> On Nov 23, 2022, at 12:06, Siddharth Jain wrote: > Is there any way to accomplish what I want? Thanks. There is: https://www.postgresql.org/docs/current/sql-alterdefaultprivileges.html

How to avoid having to run the GRANT command for newly added tables?

2022-11-23 Thread Siddharth Jain
Hello - I have a Postgres 14 server. I created a database and then gave all privileges to tables in the database to a user as shown below: grant connect on database testdb to test_user; GRANT all ON ALL TABLES IN SCHEMA "public" TO test_user; I now verified that test_user is able to access an EXIST

Re: Fwd: Postgre und GIS Umstellung von MD5 auf SCUM SHA 256

2022-11-23 Thread Peter Eisentraut
You can send questions in German to . On 23.11.22 11:22, Nikolas Hanry wrote: Liebe Community, Wir haben versucht, die Authentizierung  in unserer postgresql-Umgebung von MD5 zu SCRUM SHA 256 zu ändern (PostgreSQL V.11) - Stoppen Sie die Dienste und beenden alle aktiven Verbindungen - mit a

Re: table inheritance partition and indexes

2022-11-23 Thread Ron
Out of curiosity, why INHERITS in v13 instead of PARTITION BY? On 11/23/22 09:31, Ted Toth wrote: I've created a table with a number of indexes and then created a partition table that inherits from it using "CREATE TABLE... INHERITS..." . I've then queried pg_indexes on the parent for its index

Re: Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Danny Shemesh
Hey Laurenz, Tom - thanks again ! > that it is cheaper to use the index that supports the ORDER BY Thing is, that both queries use the exact same index (idx_hashes), but one uses it w/ the filter and one does not. > This doesn't match up terribly well with the table definition you showed before Y

Re: MERGE RETURNING

2022-11-23 Thread Simon Riggs
On Wed, 23 Nov 2022 at 19:03, Miles Elam wrote: > > Are there any plans to (or specific decisions not to) support a RETURNING > clause on MERGE statements in future versions of Postgres? The only reference > I could find in the mailing list archives was this comment, which suggested > it was de

MERGE RETURNING

2022-11-23 Thread Miles Elam
Are there any plans to (or specific decisions not to) support a RETURNING clause on MERGE statements in future versions of Postgres? The only reference I could find in the mailing list archives was this comment, which suggested it was desired but simply not technically feasible at the time. https:

Re: Fwd: Change the auth. postgresql and GIS

2022-11-23 Thread Adrian Klaver
On 11/23/22 02:23, Nikolas Hanry wrote: Dear Community, Comments inline below. we tried to change the auth. in our postgresql environment (PostgreSQL V.11) from MD5 to SCRUM SHA 256  - stop the services and killed all active connections - changed with alter and set pw the editor user to sh

table inheritance partition and indexes

2022-11-23 Thread Ted Toth
I've created a table with a number of indexes and then created a partition table that inherits from it using "CREATE TABLE... INHERITS..." . I've then queried pg_indexes on the parent for its indexes and tried creating matching indexes on the child and attaching them to the parent table indexes. Ho

Re: Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Tom Lane
Danny Shemesh writes: > -> Index Only Scan using > idx_hashes on refs (cost=0.56..722735.47 rows=33715 width=16) (actual > time=1727.208..1727.208 rows=1 loops=1) > Index Cond: (tid = > '13371337-1337-1337-1337

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Laurenz Albe
On Wed, 2022-11-23 at 12:56 +0100, Karsten Hilbert wrote: > Am Tue, Nov 22, 2022 at 11:59:59PM -0500 schrieb Kirk Wolak: > > > > It's OK to post a work-in-progress patch to pgsql-hackers, even if it > > > doesn't work right yet.  With any luck, people will show up to help > > > with problems.  I a

Re: Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Laurenz Albe
On Wed, 2022-11-23 at 15:38 +0200, Danny Shemesh wrote: > ->  Limit  (cost=0.56..24.17 rows=1 width=16) (actual time=2657.167..2657.167 > rows=1 loops=39) >       Buffers: shared hit=323452 read=887661 >       I/O Timings: read=2369932.536 >       ->  Index Only Scan using idx_hashes on refs refs_

Re: Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Danny Shemesh
Hey Laurenz, thanks for the prompt response ! What I meant is this - the plan consists of either an index scan that uses all passed columns in the index condition, or an index scan that uses only one column as an index condition, with an additional filter step. The below are explain (analyze, bu

Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...

2022-11-23 Thread Karsten Hilbert
Am Tue, Nov 22, 2022 at 11:59:59PM -0500 schrieb Kirk Wolak: > > It's OK to post a work-in-progress patch to pgsql-hackers, even if it > > doesn't work right yet. With any luck, people will show up to help > > with problems. I am 100% sure that our Windows user community would > > love this feat

Planner choose to use big index instead of smaller one

2022-11-23 Thread benj . dev
Hi, I have a table tpoint near that 820Mo with 700K lignes I have created 2 index on this table : CREATE INDEX idx_small_index ON public.tpoint USING btree (match_id); -- Size : 4560 kB CREATE INDEX idx_big_index   ON public.tpoint USING btree (version, match_id, playnum, code_action, num_balle

Fwd: Change the auth. postgresql and GIS

2022-11-23 Thread Nikolas Hanry
Dear Community, we tried to change the auth. in our postgresql environment (PostgreSQL V.11) from MD5 to SCRUM SHA 256 - stop the services and killed all active connections - changed with alter and set pw the editor user to sha (psql) - checked if the pw changes successfull (psql and pg4admin) -

Fwd: Postgre und GIS Umstellung von MD5 auf SCUM SHA 256

2022-11-23 Thread Nikolas Hanry
Liebe Community, Wir haben versucht, die Authentizierung in unserer postgresql-Umgebung von MD5 zu SCRUM SHA 256 zu ändern (PostgreSQL V.11) - Stoppen Sie die Dienste und beenden alle aktiven Verbindungen - mit alter and set pw den Editor-Benutzer auf sha (psql) geändert - überprüft, ob die pw-

Re: Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Laurenz Albe
On Wed, 2022-11-23 at 10:49 +0200, Danny Shemesh wrote: > I'm trying to understand when the planner decides to use an index condition > vs an index filter I am not sure what you mean by "index filter". If you could send the result of EXPLAIN (ANALYZE, BUFFERS) for the queries, that would be most

Index filter instead of index condition w/ IN / ANY queries above certain set size

2022-11-23 Thread Danny Shemesh
Hey everyone, I'm trying to understand when the planner decides to use an index condition vs an index filter, specifically for x IN / = ANY {set}, and if we can tune some parameters to move it between these plans. We have two tables and a query similar to the following fiddle: https://www.db-fidd