Re: [PATCH] Completed unaccent dictionary with many missing characters

2022-05-17 Thread Michael Paquier
On Thu, May 05, 2022 at 09:44:15PM +0200, Przemysław Sztoch wrote: > Tom, I disagree with you because many similar numerical conversions are > already taking place, e.g. 1/2, 1/4... This part sounds like a valid argument to me. unaccent.rules does already the conversion of some mathematical signs

Re: has_wal_read_bug

2022-05-17 Thread Noah Misch
On Tue, May 17, 2022 at 11:50:51AM +1200, Thomas Munro wrote: > 027_stream_regress.pl has: > > if (PostgreSQL::Test::Utils::has_wal_read_bug) > { > # We'd prefer to use Test::More->builder->todo_start, but the bug causes > # this test file to die(), not merely to fail. > plan skip_all

amcheck is using a wrong macro to check compressed-ness

2022-05-17 Thread Kyotaro Horiguchi
Hello. While I looked into a patch, I noticed that check_tuple_attribute does not run the check for compessed data even if a compressed data is given. check_tuple_attribute() .. struct varatt_external toast_pointer; .. VARATT_EXTERNAL_GET_POINTER(toast_pointer, attr); .. i

Re: Fix a typo in walreceiver.c

2022-05-17 Thread Michael Paquier
On Tue, May 17, 2022 at 10:38:23AM +0530, Bharath Rupireddy wrote: > Attaching a tiny patch to fix a typo - replace primary_slotname with > correct parameter name primary_slot_name in walreceiver.c code > comments. Yep, indeed. Will fix after beta1 is stamped. -- Michael signature.asc Descripti

Re: amcheck is using a wrong macro to check compressed-ness

2022-05-17 Thread Michael Paquier
On Tue, May 17, 2022 at 04:27:19PM +0900, Kyotaro Horiguchi wrote: > What do you think about the attached? The problem code is new in > PG15. Adding Robert in CC, as this has been added with bd807be. I have added an open item for now. -- Michael signature.asc Description: PGP signature

create_help.pl treats as replaceable

2022-05-17 Thread Kyotaro Horiguchi
I found it annoying that sql_help.c contains a literal parameter as a translatable string. The cause is that create_help.pl treats match as a replaceable. The attached excludes literals from translatable strings. By a quick look it seems to me that the "match" in "COPY.. HEADER match" is the firs

RE: bogus: logical replication rows/cols combinations

2022-05-17 Thread houzj.f...@fujitsu.com
On Tuesday, May 17, 2022 2:53 PM Amit Kapila wrote: > > Few minor comments: > == > 1. > + > + Names of table columns included in the publication. This contains all > + the columns of table when user didn't specify column list for the > + table. > + >

Expand palloc/pg_malloc API

2022-05-17 Thread Peter Eisentraut
This adds additional variants of palloc, pg_malloc, etc. that encapsulate common usage patterns and provide more type safety. Examples: - result = (IndexBuildResult *) palloc(sizeof(IndexBuildResult)); + result = palloc_obj(IndexBuildResult); - collector->tuples = (IndexTuple *) palloc(s

Re: Collecting statistics about contents of JSONB columns

2022-05-17 Thread Mahendra Singh Thalor
On Fri, 11 Mar 2022 at 04:29, Nikita Glukhov wrote: > > > On 04.02.2022 05:47, Tomas Vondra wrote: > > On 1/25/22 17:56, Mahendra Singh Thalor wrote: > > > > ... > > For the last few days, I was trying to understand these patches, and based on Tomas's suggestion, I was doing some performance tests

Re: Expand palloc/pg_malloc API

2022-05-17 Thread Bharath Rupireddy
On Tue, May 17, 2022 at 5:11 PM Peter Eisentraut wrote: > > This adds additional variants of palloc, pg_malloc, etc. that > encapsulate common usage patterns and provide more type safety. > > Examples: > > - result = (IndexBuildResult *) palloc(sizeof(IndexBuildResult)); > + result = palloc_ob

Re: Tracking notnull attributes inside Var

2022-05-17 Thread Ashutosh Bapat
On Sun, May 15, 2022 at 8:41 AM Andy Fan wrote: > > The var in RelOptInfo->reltarget should have nullable = 0 but the var in > RelOptInfo->baserestrictinfo should have nullable = 1; The beauty of this > are: a). It can distinguish the two situations perfectly b). Whenever we want > to know the n

Provide read-only access to system catalog tables

2022-05-17 Thread Chirag Karkera
Hi Team, Appreciate your time to look into this. I have a requirement, where a user has to be provided DDL access on the schema (which is provided to the user) and as there is some development work in process the user has to be provided the read only access on system catalog tables (information_s

Re: Data is copied twice when specifying both child and parent table in publication

2022-05-17 Thread Amit Kapila
On Fri, May 13, 2022 at 3:11 PM wangw.f...@fujitsu.com wrote: > > Attach the patches.(Only changed the patch for HEAD.). > # publications -{ oid => '6119', descr => 'get OIDs of tables in a publication', +{ oid => '6119', descr => 'get OIDs of tables in one or more publications', proname => '

Re: Provide read-only access to system catalog tables

2022-05-17 Thread David G. Johnston
On Tuesday, May 17, 2022, Chirag Karkera wrote: > > > the user has to be provided the read only access on system catalog tables > (information_schema and pg_catalog) > All roles have this, no action required. David J.

Estimation of recovery times in postgres

2022-05-17 Thread Bharath Rupireddy
Hi, We often hear customers/users asking questions like - How much time does it take for postgres to recover if it crashes now? How much time does it take for a PITR to finish if it's started now with a specific recovery target? When will the recovery of a postgres server end? It will be nice if

Re: Provide read-only access to system catalog tables

2022-05-17 Thread Chirag Karkera
Thanks David for your reply! But when i created a role i am not able to view objects under information_schema.* I mean I am not able to view the data, I can see only the column names. Thanks. Regards, Chirag Karkera On Tue, May 17, 2022 at 6:40 PM David G. Johnston < david.g.johns...@gmail.com

Re: Provide read-only access to system catalog tables

2022-05-17 Thread David G. Johnston
On Tue, May 17, 2022 at 6:21 AM Chirag Karkera wrote: > Thanks David for your reply! > > But when i created a role i am not able to view objects under > information_schema.* > > I mean I am not able to view the data, I can see only the column names. > >> >> Which goes to demonstrate you have perm

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-05-17 Thread Ranier Vilela
Em seg., 16 de mai. de 2022 às 20:26, David Rowley escreveu: > On Sun, 15 May 2022 at 09:47, Ranier Vilela wrote: > > At function load_relcache_init_file, there is an unnecessary function > call, > > to initialize pgstat_info pointer to NULL. > > > > MemSet(&rel->pgstat_info, 0, sizeof(rel->pgst

Re: PostgreSQL 15 Beta 1 release announcement draft

2022-05-17 Thread Jonathan S. Katz
On 5/15/22 10:58 PM, Amit Kapila wrote: On Sun, May 15, 2022 at 12:22 AM Jonathan S. Katz wrote: Please provide feedback no later than 2022-05-19 0:00 AoE[1]. [`recovery_prefetch`](https://www.postgresql.org/docs/15/runtime-config-wal.html#GUC-RECOVERY-PREFETCH) that can help speed up all

Re: PostgreSQL 15 Beta 1 release announcement draft

2022-05-17 Thread Jonathan S. Katz
Thanks everyone for the feedback. As per usual, I did a `MERGE` based on the suggestions. I provided credits in press.git. Here is v2 of the draft. Please provide any feedback no later than 2022-05-19 0:00 AoE. Thanks, Jonathan The PostgreSQL Global Development Group announces that the first

Re: Provide read-only access to system catalog tables

2022-05-17 Thread Chirag Karkera
Thank you for the clarification. Will use the system catalogs tables. Thank You. Regards, Chirag Karkera On Tue, May 17, 2022 at 6:59 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, May 17, 2022 at 6:21 AM Chirag Karkera > wrote: > >> Thanks David for your reply! >> >> But

Re: Removing unneeded self joins

2022-05-17 Thread Ronan Dunklau
Le vendredi 13 mai 2022, 07:07:47 CEST Andrey Lepikhov a écrit : > New version of the feature. > Here a minor bug with RowMarks is fixed. A degenerated case is fixed, > when uniqueness of an inner deduced not from join quals, but from a > baserestrictinfo clauses 'x=const', where x - unique field.

Re: PostgreSQL 15 Beta 1 release announcement draft

2022-05-17 Thread Justin Pryzby
On Tue, May 17, 2022 at 08:58:14AM -0500, Jonathan S. Katz wrote: > PostgreSQL 15 adds [more regular expression > functions](https://www.postgresql.org/docs/15/functions-matching.html#FUNCTIONS-POSIX-REGEXP), > including `regexp_count` , `regexp_instr`, `regexp_like`, and `regexp_substr`. > the [`

Re: create_help.pl treats as replaceable

2022-05-17 Thread Tom Lane
Kyotaro Horiguchi writes: > I found it annoying that sql_help.c contains a literal parameter as a > translatable string. > The cause is that create_help.pl treats match as a > replaceable. The attached excludes literals from translatable strings. > By a quick look it seems to me that the "match"

Re: Collecting statistics about contents of JSONB columns

2022-05-17 Thread Tomas Vondra
On 5/17/22 13:44, Mahendra Singh Thalor wrote: > ... > > Hi Nikita, > I and Tomas discussed the design for disabling all-paths > collection(collect stats for only some paths). Below are some > thoughts/doubts/questions. > > *Point 1)* Please can you elaborate more that how are you going to > imple

Re: Add WAL recovery messages with log_wal_traffic GUC (was: add recovery, backup, archive, streaming etc. activity messages to server logs along with ps display)

2022-05-17 Thread Robert Haas
On Tue, May 17, 2022 at 1:32 AM Bharath Rupireddy wrote: > In a production environment (of course with a better management of > server logs) one can set log_wal_traffic to "high" and emit the > required info to answer some of the customer questions like - "How far > the server is in recovery? How

Re: Remove support for Visual Studio 2013

2022-05-17 Thread Juan José Santamaría Flecha
On Mon, May 16, 2022 at 8:58 AM Michael Paquier wrote: > > The patch attached cleans up the following things proper to VS 2013: > - Locale handling. > - MIN_WINNT assignment. > - Some strtof() business, as of win32_port.h. > - Removal of _set_FMA3_enable() in main.c related to floating-point > op

Re: Tracking notnull attributes inside Var

2022-05-17 Thread Tom Lane
Andy Fan writes: > notnulls discussion is forked from UniqueKey stuff, you can see the > attachment > for the UnqiueKey introduction. Tom raised his opinion to track the > nullability > inside Var[1][2][3], this thread would start from there based on my > understanding. I'm pretty certain that I

Re: Expand palloc/pg_malloc API

2022-05-17 Thread Tom Lane
Bharath Rupireddy writes: > On Tue, May 17, 2022 at 5:11 PM Peter Eisentraut > wrote: >> This adds additional variants of palloc, pg_malloc, etc. that >> encapsulate common usage patterns and provide more type safety. > I see lots of instances where there's no explicit type-casting to the > targ

Re: Zstandard support for toast compression

2022-05-17 Thread Robert Haas
On Tue, May 17, 2022 at 12:19 AM Michael Paquier wrote: > Toast compression is supported for LZ4, and thanks to the refactoring > work done with compression methods assigned to an attribute, adding > support for more methods is straight-forward, as long as we don't > support more than 4 methods as

Re: Zstandard support for toast compression

2022-05-17 Thread Stephen Frost
Greetings, * Robert Haas (robertmh...@gmail.com) wrote: > On Tue, May 17, 2022 at 12:19 AM Michael Paquier wrote: > > Toast compression is supported for LZ4, and thanks to the refactoring > > work done with compression methods assigned to an attribute, adding > > support for more methods is strai

Limiting memory allocation

2022-05-17 Thread Stephen Frost
Greetings, An ongoing issue in container environments where Kubernetes is being used is that setting the overcommit parameters on the base system will impact all of the processes on that system and not all of them handle malloc failing as gracefully as PG does and may allocate more than what they

Re: Zstandard support for toast compression

2022-05-17 Thread Tom Lane
Stephen Frost writes: > * Robert Haas (robertmh...@gmail.com) wrote: >> Yeah - I think we had better reserve the fourth bit pattern for >> something extensible e.g. another byte or several to specify the >> actual method, so that we don't have a hard limit of 4 methods. But >> even with such a sys

Re: Limiting memory allocation

2022-05-17 Thread Jan Wieck
On 5/17/22 15:42, Stephen Frost wrote: Thoughts? Yes. The main and foremost problem is a server that is used for multiple services and they behave differently when it comes to memory allocation. One service just allocates like we have petabytes of RAM, then uses little of it, while another

Re: Zstandard support for toast compression

2022-05-17 Thread Stephen Frost
Greetings, * Tom Lane (t...@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > * Robert Haas (robertmh...@gmail.com) wrote: > >> Yeah - I think we had better reserve the fourth bit pattern for > >> something extensible e.g. another byte or several to specify the > >> actual method, so that we don'

Re: Limiting memory allocation

2022-05-17 Thread Tom Lane
Jan Wieck writes: > On 5/17/22 15:42, Stephen Frost wrote: >> Thoughts? > Using cgroups one can actually force a certain process (or user, or > service) to use swap if and when that service is using more memory than > it was "expected" to use. I wonder if we shouldn't just provide documentatio

Re: Limiting memory allocation

2022-05-17 Thread Stephen Frost
Greetings, On Tue, May 17, 2022 at 18:12 Tom Lane wrote: > Jan Wieck writes: > > On 5/17/22 15:42, Stephen Frost wrote: > >> Thoughts? > > > Using cgroups one can actually force a certain process (or user, or > > service) to use swap if and when that service is using more memory than > > it was

Re: Limiting memory allocation

2022-05-17 Thread Tom Lane
Stephen Frost writes: > On Tue, May 17, 2022 at 18:12 Tom Lane wrote: >> ulimit might be interesting to check into as well. The last time I >> looked, it wasn't too helpful for this on Linux, but that was years ago. > Unfortunately I really don’t think anything here has materially changed in >

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-05-17 Thread Ranier Vilela
Em ter., 17 de mai. de 2022 às 10:33, Ranier Vilela escreveu: > Em seg., 16 de mai. de 2022 às 20:26, David Rowley > escreveu: > >> On Sun, 15 May 2022 at 09:47, Ranier Vilela wrote: >> > At function load_relcache_init_file, there is an unnecessary function >> call, >> > to initialize pgstat_in

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-05-17 Thread Justin Pryzby
On Tue, May 17, 2022 at 07:52:30PM -0300, Ranier Vilela wrote: > I found, I believe, a serious problem of incorrect usage of the memset api. > Historically, people have relied on using memset or MemSet, using the > variable name as an argument for the sizeof. > While it works correctly, for arrays,

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-05-17 Thread Tom Lane
Ranier Vilela writes: > I found, I believe, a serious problem of incorrect usage of the memset api. > Historically, people have relied on using memset or MemSet, using the > variable name as an argument for the sizeof. > While it works correctly, for arrays, when it comes to pointers to > structur

Re: Avoid unecessary MemSet call (src/backend/utils/cache/relcache.c)

2022-05-17 Thread Ranier Vilela
Em ter., 17 de mai. de 2022 às 20:18, Justin Pryzby escreveu: > On Tue, May 17, 2022 at 07:52:30PM -0300, Ranier Vilela wrote: > > I found, I believe, a serious problem of incorrect usage of the memset > api. > > Historically, people have relied on using memset or MemSet, using the > > variable n

ALTER TABLE SET ACCESS METHOD on partitioned tables

2022-05-17 Thread Soumyadeep Chakraborty
Hello, This is a fresh thread to continue the discussion on ALTER TABLE SET ACCESS METHOD when applied to partition roots, as requested. Current behavior (HEAD): CREATE TABLE am_partitioned(x INT, y INT) PARTITION BY hash (x); ALTER TABLE am_partitioned SET ACCESS METHOD heap2; ERROR: cannot

Re: Remove support for Visual Studio 2013

2022-05-17 Thread Michael Paquier
On Tue, May 17, 2022 at 06:26:20PM +0200, Juan José Santamaría Flecha wrote: > This is because current MinGW defaults to Windows 2003 [1], maybe we should > fix Windows' minimal version to Vista (0x0600) unconditionally also. I have > seen a couple of compilation warnings while testing that setting

Re: pgbench --partitions=0

2022-05-17 Thread Michael Paquier
On Mon, May 16, 2022 at 03:00:51PM +0900, Michael Paquier wrote: > (I have added an open item, just in case.) And fixed as of 27f1366. -- Michael signature.asc Description: PGP signature

Re: amcheck is using a wrong macro to check compressed-ness

2022-05-17 Thread Michael Paquier
On Tue, May 17, 2022 at 04:58:11PM +0900, Michael Paquier wrote: > Adding Robert in CC, as this has been added with bd807be. I have > added an open item for now. With the individual in CC, that's even better. -- Michael signature.asc Description: PGP signature

Re: create_help.pl treats as replaceable

2022-05-17 Thread Kyotaro Horiguchi
At Tue, 17 May 2022 11:09:23 -0400, Tom Lane wrote in > but that just seems flat-out wrong. If "match" is a keyword it should > be rendered like other keywords. I'm not very interested in splitting > hairs about whether the grammar thinks it is a keyword --- it looks like > one to a user. So I

Re: pgbench --partitions=0

2022-05-17 Thread Amit Langote
On Wed, May 18, 2022 at 9:50 Michael Paquier wrote: > On Mon, May 16, 2022 at 03:00:51PM +0900, Michael Paquier wrote: > > (I have added an open item, just in case.) > > And fixed as of 27f1366 Thank you. -- Thanks, Amit Langote EDB: http://www.enterprisedb.com

funcs.sgml - wrong example

2022-05-17 Thread Erik Rijkers
funcs.sgml has 42 <@ '{[1,7)}'::int4multirange and calls it true. The attached fixes that. Included are two more changes where actual output differs a bit from what the doc examples show. Erik --- doc/src/sgml/func.sgml.orig 2022-05-17 17:50:40.975410855 +0200 +++ doc/src/sgml/func.sgml

Re: funcs.sgml - wrong example

2022-05-17 Thread Kyotaro Horiguchi
At Wed, 18 May 2022 03:08:32 +0200, Erik Rijkers wrote in > funcs.sgml has > > 42 <@ '{[1,7)}'::int4multirange > > and calls it true. The attached fixes that. > > Included are two more changes where actual output differs a bit from > what the doc examples show. A bit off-topic and just ou

Re: funcs.sgml - wrong example

2022-05-17 Thread Kyotaro Horiguchi
At Wed, 18 May 2022 11:11:02 +0900 (JST), Kyotaro Horiguchi wrote in > At Wed, 18 May 2022 03:08:32 +0200, Erik Rijkers wrote in > > funcs.sgml has > > > > 42 <@ '{[1,7)}'::int4multirange > > > > and calls it true. The attached fixes that. > > > > Included are two more changes where act

Re: bogus: logical replication rows/cols combinations

2022-05-17 Thread Amit Kapila
On Tue, May 17, 2022 at 2:40 PM houzj.f...@fujitsu.com wrote: > > Attach the new version patch which addressed all the above comments and > comments from Shi yu[1] and Osumi-san[2]. > Thanks, your first patch looks good to me. I'll commit that tomorrow unless there are more comments on the same.

RE: Skipping schema changes in publication

2022-05-17 Thread shiy.f...@fujitsu.com
On Sat, May 14, 2022 9:33 PM vignesh C wrote: > > Thanks for the comments, the attached v5 patch has the changes for the > same. Also I have made the changes for SKIP Table based on the new > syntax, the changes for the same are available in > v5-0002-Skip-publishing-the-tables-specified-in-EXCEP

Valgrind mem-check for postgres extension

2022-05-17 Thread Natarajan R
Hi pg-hackers, I have written a postgres extension, and know that memory leak check can be done with valgrind. With the help of postgres_valgrind_wiki started postgres server with the valgrind(as given in the wiki) valgrind --leak-check=no --gen-suppres

Re: Handle infinite recursion in logical replication setup

2022-05-17 Thread Amit Kapila
On Wed, May 4, 2022 at 12:17 PM vignesh C wrote: > > Thanks for the comments, the attached v13 patch has the changes for the same. > Few comments on v13-0001 == 1. + * + * FIXME: LOGICALREP_PROTO_LOCALONLY_VERSION_NUM needs to be bumped to 4 in + * PG16. ... @@ -477,6 +489,12

Re: Valgrind mem-check for postgres extension

2022-05-17 Thread Tom Lane
Natarajan R writes: > I have few doubts in here, > 1. When I run with *--leak-check=full*, I get memory leaks for postgres > functions under possibly or definitely lost categories.. Is this expected? Maybe ... you did not show your test case, so it's hard to say. But it could well be that this

Re: Zstandard support for toast compression

2022-05-17 Thread Michael Paquier
On Tue, May 17, 2022 at 04:12:14PM -0400, Stephen Frost wrote: > * Tom Lane (t...@sss.pgh.pa.us) wrote: >> I'm with Robert in that I do not see any urgency to add another method. Okay. >> The fact that Stephen is already questioning whether LZ4 should have >> been added first is not making me any