Re: Fix typo in verify_heapam.c

2021-04-02 Thread Fujii Masao
On 2021/04/02 15:02, Masahiko Sawada wrote: Hi all, I found typos in verify_heapam.c. s/comitted/committed/ Please find an attached patch. Thanks for the report and patch! Pushed. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA

RE: Fix pg_checksums progress report

2021-04-02 Thread Shinya11.Kato
>-Original Message- >From: Fujii Masao >Sent: Friday, April 2, 2021 2:39 PM >To: shinya11.k...@nttdata.com; pgsql-hack...@postgresql.org >Subject: Re: Fix pg_checksums progress report > > > >On 2021/04/02 14:23, shinya11.k...@nttdata.com wrote: >> Hi, >> >> I found a problem with the pg_ch

Re: making update/delete of inheritance trees scale better

2021-04-02 Thread Amit Langote
On Wed, Mar 31, 2021 at 9:54 PM Amit Langote wrote: > I reran some of the performance tests I did earlier (I've attached the > modified test running script for reference): For archives' sake, noticing a mistake in my benchmarking script, I repeated the tests. Apparently, all pgbench runs were per

Re: invalid data in file backup_label problem on windows

2021-04-02 Thread Michael Paquier
On Thu, Apr 01, 2021 at 09:56:02AM +0900, Michael Paquier wrote: > Okay, that sounds good to me. Applied and backpatched then as 6fb66c26 & co. -- Michael signature.asc Description: PGP signature

Re: Fix typo in verify_heapam.c

2021-04-02 Thread Masahiko Sawada
On Fri, Apr 2, 2021 at 4:28 PM Fujii Masao wrote: > > > > On 2021/04/02 15:02, Masahiko Sawada wrote: > > Hi all, > > > > I found typos in verify_heapam.c. > > > > s/comitted/committed/ > > > > Please find an attached patch. > > Thanks for the report and patch! Pushed. Thank you! Regards, -- M

Re: Fix pg_checksums progress report

2021-04-02 Thread Michael Paquier
On Fri, Apr 02, 2021 at 07:30:32AM +, shinya11.k...@nttdata.com wrote: > I added a comment to the patch, and attached the new patch. Hmm. This looks to come from 280e5f14 that introduced the progress reports so this would need a backpatch down to 12. I have not looked in details and have not

why pg_walfile_name() cannot be executed during recovery?

2021-04-02 Thread SATYANARAYANA NARLAPURAM
Hello Hackers, Why pg_walfile_name() can't be executed under recovery? What is the best way for me to get the current timeline and/or the file being recovering on the standby using a postgres query? I know I can get it via process title but don't want to go that route. Thanks, Satya

Re: Data type correction in pgstat_report_replslot function parameters

2021-04-02 Thread Fujii Masao
On 2021/04/02 11:20, vignesh C wrote: On Thu, Apr 1, 2021 at 11:18 PM Fujii Masao wrote: On 2021/04/02 2:18, Jeevan Ladhe wrote: On Thu, Apr 1, 2021 at 10:20 PM vignesh C mailto:vignes...@gmail.com>> wrote: Hi, While I was reviewing replication slot statistics code, I found

badly calculated width of emoji in psql

2021-04-02 Thread Pavel Stehule
Hi I am checked an query from https://www.depesz.com/2021/04/01/waiting-for-postgresql-14-add-unistr-function/ article. postgres=# SELECT U&'\+01F603'; ┌──┐ │ ?column? │ ╞══╡ │ 😃│ └──┘ (1 row) The result is not correct. Emoji has width 2 chars, but psql calculate

Re: Fix pg_checksums progress report

2021-04-02 Thread Fujii Masao
On 2021/04/02 16:47, Michael Paquier wrote: On Fri, Apr 02, 2021 at 07:30:32AM +, shinya11.k...@nttdata.com wrote: I added a comment to the patch, and attached the new patch. Thanks for updating the patch! + /* +* The current_size is calculated before chec

Re: Add Nullif case for eval_const_expressions_mutator

2021-04-02 Thread Peter Eisentraut
On 30.03.21 11:20, Peter Eisentraut wrote: On 24.03.21 11:52, houzj.f...@fujitsu.com wrote: +    if (!has_nonconst_input) +    return ece_evaluate_expr(expr); That's not okay without a further check to see if the comparison function used by the node is immutable. 

RE: Fix pg_checksums progress report

2021-04-02 Thread Shinya11.Kato
>-Original Message- >From: Fujii Masao >Sent: Friday, April 2, 2021 6:03 PM >To: Michael Paquier ; shinya11.k...@nttdata.com >Cc: pgsql-hack...@postgresql.org >Subject: Re: Fix pg_checksums progress report > > > >On 2021/04/02 16:47, Michael Paquier wrote: >> On Fri, Apr 02, 2021 at 07:30:

Re: badly calculated width of emoji in psql

2021-04-02 Thread Laurenz Albe
On Fri, 2021-04-02 at 10:45 +0200, Pavel Stehule wrote: > I am checked an query from > https://www.depesz.com/2021/04/01/waiting-for-postgresql-14-add-unistr-function/ > article. > > postgres=# SELECT U&'\+01F603'; > ┌──┐ > │ ?column? │ > ╞══╡ > │ 😃│ > └──┘ > (1 r

Re: badly calculated width of emoji in psql

2021-04-02 Thread Pavel Stehule
pá 2. 4. 2021 v 11:37 odesílatel Laurenz Albe napsal: > On Fri, 2021-04-02 at 10:45 +0200, Pavel Stehule wrote: > > I am checked an query from > https://www.depesz.com/2021/04/01/waiting-for-postgresql-14-add-unistr-function/ > article. > > > > postgres=# SELECT U&'\+01F603'; > > ┌──┐ > >

Re: Fix pg_checksums progress report

2021-04-02 Thread Michael Paquier
On Fri, Apr 02, 2021 at 06:03:21PM +0900, Fujii Masao wrote: > On 2021/04/02 16:47, Michael Paquier wrote: >> I have not looked >> in details and have not looked at the patch yet, though. Fujii-san, >> are you planning to take care of that? > > Yes, I will. Thanks for the consideration! OK, than

Re: Refactoring HMAC in the core code

2021-04-02 Thread Michael Paquier
On Mon, Feb 15, 2021 at 08:25:27PM +0900, Michael Paquier wrote: > Again a new rebase, giving v5: > - Fixed the APIs to return -1 if the caller gives NULL in input, to be > consistent with cryptohash. > - Added a length argument to pg_hmac_final(), wiht sanity checks. So, this patch has been aroun

Re: [PATCH] postgres_fdw connection caching - cause remote sessions linger till the local session exit

2021-04-02 Thread Fujii Masao
On 2021/04/02 2:22, Fujii Masao wrote: Thanks a lot! Barring any objection, I will commit this version. Pushed. Thanks! Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

Re: why pg_walfile_name() cannot be executed during recovery?

2021-04-02 Thread Robert Haas
On Fri, Apr 2, 2021 at 4:23 AM SATYANARAYANA NARLAPURAM wrote: > Why pg_walfile_name() can't be executed under recovery? I believe the issue is that the backend executing the function might not have an accurate idea about which TLI to use. But I don't understand why we can't find some solution to

Re: SQL-standard function body

2021-04-02 Thread Peter Eisentraut
On 31.03.21 12:12, Julien Rouhaud wrote: On Tue, Mar 23, 2021 at 11:28:55PM -0500, Jaime Casanova wrote: On Fri, Mar 19, 2021 at 8:49 AM Peter Eisentraut wrote: Right. Here is a new patch with that fix added and a small conflict resolved. Great. It seems print_function_sqlbody() is not pr

Re: libpq debug log

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Kyotaro Horiguchi wrote: > At Fri, 02 Apr 2021 14:40:09 +0900 (JST), Kyotaro Horiguchi > wrote in > > So, the cheapest measure for regression test would be just making the > > So, the cheapest measure for regression test would be just *masking* the > > > length field, while r

Re: simplifying foreign key/RI checks

2021-04-02 Thread Amit Langote
On Sat, Mar 20, 2021 at 10:21 PM Amit Langote wrote: > Updated patches attached. Sorry about the delay. Rebased over the recent DETACH PARTITION CONCURRENTLY work. Apparently, ri_ReferencedKeyExists() was using the wrong snapshot. -- Amit Langote EDB: http://www.enterprisedb.com v8-0001-Expo

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Isaac Morland
On Fri, 2 Apr 2021 at 01:44, Dan Lynch wrote: > RLS policies quals/checks are optimized inline, and so I generally avoid > writing a separate procedure so the optimizer can do it's thing. > > However, if you need a security definer to avoid recursive RLS if you're > doing a more complex query say

Re: a misbehavior of partition row movement (?)

2021-04-02 Thread Amit Langote
On Thu, Apr 1, 2021 at 10:56 AM Masahiko Sawada wrote: > On Tue, Mar 23, 2021 at 6:27 PM Amit Langote wrote: > > Actually, I found a big hole in my assumptions around deferrable > > foreign constraints, invalidating the approach I took in 0002 to use a > > query-lifetime tuplestore to record root

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Stephen Frost
Greetings, * Isaac Morland (isaac.morl...@gmail.com) wrote: > On Fri, 2 Apr 2021 at 01:44, Dan Lynch wrote: > > RLS policies quals/checks are optimized inline, and so I generally avoid > > writing a separate procedure so the optimizer can do it's thing. > > > > However, if you need a security def

Why reset pgstat during recovery

2021-04-02 Thread 蔡梦娟(玊于)
Hi, all I want to know why call pgstat_reset_all function during recovery process, under what circumstances the data will be invalid after recovery? Thanks & Best Regard

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Chapman Flack
On 04/02/21 09:09, Isaac Morland wrote: > If we're going to do this we should do the same for triggers as well. > > ... it's easy to imagine a situation in which a trigger needs to > write to another table which should not be accessible to the role using the > table which has the trigger. Trigger

Re: libpq debug log

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Alvaro Herrera wrote: > On 2021-Apr-02, Kyotaro Horiguchi wrote: > > > At Fri, 02 Apr 2021 14:40:09 +0900 (JST), Kyotaro Horiguchi > > wrote in > > > > So, the cheapest measure for regression test would be just making the > > > > So, the cheapest measure for regression test w

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Isaac Morland
On Fri, 2 Apr 2021 at 09:30, Stephen Frost wrote: > Greetings, > > * Isaac Morland (isaac.morl...@gmail.com) wrote: > > On Fri, 2 Apr 2021 at 01:44, Dan Lynch wrote: > > > RLS policies quals/checks are optimized inline, and so I generally > avoid > > > writing a separate procedure so the optimiz

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Isaac Morland
On Fri, 2 Apr 2021 at 09:44, Chapman Flack wrote: > On 04/02/21 09:09, Isaac Morland wrote: > > If we're going to do this we should do the same for triggers as well. > > > > ... it's easy to imagine a situation in which a trigger needs to > > write to another table which should not be accessible

Re: libpq debug log

2021-04-02 Thread Tom Lane
Alvaro Herrera writes: > As in the attached patch. +1, but the comment could be more specific. Maybe like "In regress mode, suppress the length of ErrorResponse and NoticeResponse messages --- the F (file name) field, in particular, can vary in length depending on compiler used." Actually thoug

Re: Refactoring HMAC in the core code

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 07:04:18PM +0900, Michael Paquier wrote: > On Mon, Feb 15, 2021 at 08:25:27PM +0900, Michael Paquier wrote: > > Again a new rebase, giving v5: > > - Fixed the APIs to return -1 if the caller gives NULL in input, to be > > consistent with cryptohash. > > - Added a length argu

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Joe Conway
On 4/2/21 9:57 AM, Isaac Morland wrote: Views already run security definer, allowing them to be used for some of the same information-hiding purposes as RLS. But I just found something strange: current_user/_role returns the user's role, not the view owner's role: postgres=# set role to t1; S

Re: Process initialization labyrinth

2021-04-02 Thread Mike Palmiotto
On Thu, Apr 1, 2021 at 8:22 PM Andres Freund wrote: > > I have now worked around this by generous application of ugly, but I > think we really need to do something about this mazy mess. There's just > an insane amount of duplication, and it's too complicated to remember > more than a few minutes.

Re: documentation fix for SET ROLE

2021-04-02 Thread Laurenz Albe
On Mon, 2021-03-15 at 17:09 +, Bossart, Nathan wrote: > On 3/15/21, 7:06 AM, "Laurenz Albe" wrote: > > On Fri, 2021-03-12 at 21:41 +, Bossart, Nathan wrote: > > > On 3/12/21, 11:14 AM, "Joe Conway" wrote: > > > > Looking back at the commit history it seems to me that this only works > > >

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Stephen Frost
Greetings, * Joe Conway (m...@joeconway.com) wrote: > On 4/2/21 9:57 AM, Isaac Morland wrote: > >Views already run security definer, allowing them to be used for some of > >the same information-hiding purposes as RLS. But I just found something > >strange: current_user/_role returns the user's rol

Re: A reloption for partitioned tables - parallel_workers

2021-04-02 Thread Laurenz Albe
On Wed, 2021-03-24 at 14:14 +1300, David Rowley wrote: > On Fri, 19 Mar 2021 at 02:07, Amit Langote wrote: > > Attached a new version rebased over c8f78b616, with the grouping > > relation partitioning enhancements as a separate patch 0001. Sorry > > about the delay. > > I had a quick look at th

Re: libpq debug log

2021-04-02 Thread Tom Lane
I wrote: > I bet what is happening on drongo is that the compiler has generated a > __FILE__ value that contains backslashes not slashes, and this code > doesn't know how to shorten those. So maybe instead of lobotomizing > this test, we should fix that. Did that, but we'll have to wait a few hou

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Joe Conway
On 4/2/21 10:23 AM, Stephen Frost wrote: Greetings, * Joe Conway (m...@joeconway.com) wrote: On 4/2/21 9:57 AM, Isaac Morland wrote: >Views already run security definer, allowing them to be used for some of >the same information-hiding purposes as RLS. But I just found something >strange: curre

Re: Stronger safeguard for archive recovery not to miss data

2021-04-02 Thread Laurenz Albe
On Thu, 2021-04-01 at 17:25 +0900, Fujii Masao wrote: > Thanks for updating the patch! > > +errhint("Use a backup taken after setting > wal_level to higher than minimal " > +"or recover to the point in > time before

Re: libpq debug log

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Tom Lane wrote: > I wrote: > > I bet what is happening on drongo is that the compiler has generated a > > __FILE__ value that contains backslashes not slashes, and this code > > doesn't know how to shorten those. So maybe instead of lobotomizing > > this test, we should fix that.

Re: simplifying foreign key/RI checks

2021-04-02 Thread Zhihong Yu
Hi, + skip = !ExecLockTableTuple(erm->relation, &tid, markSlot, + estate->es_snapshot, estate->es_output_cid, + lockmode, erm->waitPolicy, &epq_needed); + if (skip) It seems the variable skip is only used above. The var

Re: libpq debug log

2021-04-02 Thread Tom Lane
I wrote: >> I bet what is happening on drongo is that the compiler has generated a >> __FILE__ value that contains backslashes not slashes, and this code >> doesn't know how to shorten those. So maybe instead of lobotomizing >> this test, we should fix that. > Did that, but we'll have to wait a f

Re: simplifying foreign key/RI checks

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Amit Langote wrote: > On Sat, Mar 20, 2021 at 10:21 PM Amit Langote wrote: > > Updated patches attached. Sorry about the delay. > > Rebased over the recent DETACH PARTITION CONCURRENTLY work. > Apparently, ri_ReferencedKeyExists() was using the wrong snapshot. Hmm, I wonder if

Re: libpq debug log

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Tom Lane wrote: > On third thought, maybe we should push your patch too. Although I think > 53aafdb9f is going to fix the platform-specific aspect of this, we are > still going to risk some implementation dependence of the libpq_pipeline > results: > > * Every so often, the numbe

Re: Fix pg_checksums progress report

2021-04-02 Thread Fujii Masao
On 2021/04/02 18:19, shinya11.k...@nttdata.com wrote: Thanks for your review! I updated the patch, and attached it. Thanks for updating the patch! Pushed. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION

Re: Asynchronous and "direct" IO support for PostgreSQL.

2021-04-02 Thread Dmitry Dolgov
Sorry for another late reply, finally found some time to formulate couple of thoughts. > On Thu, Feb 25, 2021 at 09:22:43AM +0100, Dmitry Dolgov wrote: > > On Wed, Feb 24, 2021 at 01:45:10PM -0800, Andres Freund wrote: > > > > > I'm curious if it makes sense > > > to explore possibility to have th

SP-GiST confusion: indexed column's type vs. index column type

2021-04-02 Thread Tom Lane
While reviewing Pavel Borisov's patch to enable INCLUDE columns in SP-GiST, I found some things that seem like pre-existing bugs. These only accidentally fail to cause any problems in the existing SP-GiST opclasses: 1. The attType passed to an opclass's config method is documented as Oid

Re: SP-GiST confusion: indexed column's type vs. index column type

2021-04-02 Thread Peter Geoghegan
On Fri, Apr 2, 2021 at 9:37 AM Tom Lane wrote: > I propose changing things so that > > (A) attType really is the input (heap) data type. > > (B) We enforce that leafType agrees with the opclass opckeytype, > ensuring the index tupdesc can be used for leaf tuples. > > (C) The tupdesc passed back fo

Re: Process initialization labyrinth

2021-04-02 Thread Andres Freund
Hi, On 2021-04-02 10:18:20 -0400, Mike Palmiotto wrote: > I can't really speak to the initial points directly relating to > pgstat/shmem, but for the overall maze-like nature of the startup > code: is there any chance the startup centralization patchset would be > of any help here? > https://www.p

Re: Force lookahead in COPY FROM parsing

2021-04-02 Thread John Naylor
On Thu, Apr 1, 2021 at 4:47 PM Heikki Linnakangas wrote: > Ok, I wouldn't expect to see much difference in that test, it gets > drowned in all the other parsing overhead. I tested this now with this: > > copy (select repeat('x', 1) from generate_series(1, 10)) to > '/tmp/copydata-x.txt' >

Re: shared-memory based stats collector

2021-04-02 Thread Andres Freund
Hi, On 2021-04-02 15:34:54 +0900, Kyotaro Horiguchi wrote: > At Thu, 1 Apr 2021 19:44:25 -0700, Andres Freund wrote > in > > Hi, > > > > I spent quite a bit more time working on the patch. There's are large > > changes: > > > > - postmaster/pgstats.c (which is an incorrect location now that i

Re: Parallel Full Hash Join

2021-04-02 Thread Melanie Plageman
On Fri, Mar 5, 2021 at 8:31 PM Thomas Munro wrote: > > On Tue, Mar 2, 2021 at 11:27 PM Thomas Munro wrote: > > On Fri, Feb 12, 2021 at 11:02 AM Melanie Plageman > > wrote: > > > I just attached the diff. > > > > Squashed into one patch for the cfbot to chew on, with a few minor > > adjustments t

Re: Process initialization labyrinth

2021-04-02 Thread Mike Palmiotto
On Fri, Apr 2, 2021 at 1:02 PM Andres Freund wrote: > > Hi, > > On 2021-04-02 10:18:20 -0400, Mike Palmiotto wrote: > > I can't really speak to the initial points directly relating to > > pgstat/shmem, but for the overall maze-like nature of the startup > > code: is there any chance the startup ce

Re: documentation fix for SET ROLE

2021-04-02 Thread Joe Conway
On 4/2/21 10:21 AM, Laurenz Albe wrote: On Mon, 2021-03-15 at 17:09 +, Bossart, Nathan wrote: On 3/15/21, 7:06 AM, "Laurenz Albe" wrote: > On Fri, 2021-03-12 at 21:41 +, Bossart, Nathan wrote: > > On 3/12/21, 11:14 AM, "Joe Conway" wrote: > > > Looking back at the commit history it see

Re: Rename of triggers for partitioned tables

2021-04-02 Thread Arne Roland
Hi, attached a patch with some cleanup and a couple of test cases. The lookup is now done with the parentid and the renaming affects detached partitions as well. The test cases are not perfectly concise, but only add about 0.4 % to the total runtime of regression tests at my machine. So I did

Re: documentation fix for SET ROLE

2021-04-02 Thread Bossart, Nathan
On 4/2/21, 10:54 AM, "Joe Conway" wrote: > On 4/2/21 10:21 AM, Laurenz Albe wrote: >> So I think that documenting this is the way to go. I'll mark it as >> "ready for committer". > > pushed Thanks! Nathan

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Thu, Apr 1, 2021 at 09:46:58PM -0700, Bryn Llewellyn wrote: > Or am I misunderstanding something? > > Try this. The result of each “select” is shown as the trailing comment on the > same line. I added whitespace by hand to line up the fields. > > select interval '-1.7 years';

Re: invalid data in file backup_label problem on windows

2021-04-02 Thread David Steele
On 4/2/21 3:43 AM, Michael Paquier wrote: On Thu, Apr 01, 2021 at 09:56:02AM +0900, Michael Paquier wrote: Okay, that sounds good to me. Applied and backpatched then as 6fb66c26 & co. Thank you! -- -David da...@pgmasters.net

Re: Proposal: Save user's original authenticated identity for logging

2021-04-02 Thread Jacob Champion
On Fri, 2021-04-02 at 13:45 +0900, Michael Paquier wrote: > Attached is what I have come up with as the first building piece, > which is basically a combination of 0001 and 0002, except that I > modified things so as the number of arguments remains minimal for all > the routines. This avoids the m

Re: Parallel Full Hash Join

2021-04-02 Thread Zhihong Yu
Hi, For v6-0003-Parallel-Hash-Full-Right-Outer-Join.patch +* current_chunk_idx: index in current HashMemoryChunk The above comment seems to be better fit for ExecScanHashTableForUnmatched(), instead of ExecParallelPrepHashTableForUnmatched. I wonder where current_chunk_idx should belong (cons

Making wait events a bit more efficient

2021-04-02 Thread Andres Freund
Hi, This grew out of my patch to split the waits event code out of pgstat.[ch], which in turn grew out of the shared memory stats patch series. pgstat_report_wait_start() and pgstat_report_wait_end() currently check pgstat_track_activities before assigning to MyProc->wait_event_info. Given the s

Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

2021-04-02 Thread Peter Eisentraut
On 23.03.21 16:08, Japin Li wrote: I check the duplicates for newpublist in merge_publications(). The code is copied from publicationListToArray(). I do not check for all duplicates because it will make the code more complex. For example: ALTER SUBSCRIPTION mysub ADD PUBLICATION mypub2, mypub2,

Re: CLUSTER on partitioned index

2021-04-02 Thread Justin Pryzby
@cfbot: rebased >From 686cd8fc644f1f86d81d7748b66feddd634c4dc8 Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Thu, 26 Nov 2020 14:37:08 -0600 Subject: [PATCH v10 1/8] pg_dump: make CLUSTER ON a separate dump object.. ..since it needs to be restored after any child indexes are restored *and at

Re: Making wait events a bit more efficient

2021-04-02 Thread Zhihong Yu
Hi, +extern PGDLLIMPORT uint32 *my_wait_event_info; It seems volatile should be added to the above declaration. Since later: + *(volatile uint32 *) my_wait_event_info = wait_event_info; Cheers On Fri, Apr 2, 2021 at 12:45 PM Andres Freund wrote: > Hi, > > This grew out of my patch to split

Re: Making wait events a bit more efficient

2021-04-02 Thread Andres Freund
Hi, On 2021-04-02 13:06:35 -0700, Zhihong Yu wrote: > +extern PGDLLIMPORT uint32 *my_wait_event_info; > > It seems volatile should be added to the above declaration. Since later: > > + *(volatile uint32 *) my_wait_event_info = wait_event_info; Why? We really just want to make the store volati

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Zhihong Yu
Bruce: Thanks for tackling this issue. The patch looks good to me. When you have time, can you include the places which were not covered by the current diff ? Cheers On Fri, Apr 2, 2021 at 11:06 AM Bruce Momjian wrote: > On Thu, Apr 1, 2021 at 09:46:58PM -0700, Bryn Llewellyn wrote: > > Or am

Re: Add client connection check during the execution of the query

2021-04-02 Thread Thomas Munro
On Fri, Apr 2, 2021 at 6:18 PM tsunakawa.ta...@fujitsu.com wrote: > The patch looks committable to me. I checked for performance impact compared to master with pgbench -S, and didn't see any problem. I thought more about how to write a decent race-free test but struggled with the lack of a good

Re: Making wait events a bit more efficient

2021-04-02 Thread Zhihong Yu
Hi, Maybe I am not familiar with your patch. I don't see where my_wait_event_info is read (there is no getter method in the patch). In that case, it is fine omitting volatile in the declaration. Cheers On Fri, Apr 2, 2021 at 1:10 PM Andres Freund wrote: > Hi, > > On 2021-04-02 13:06:35 -0700,

Re: Making wait events a bit more efficient

2021-04-02 Thread Andres Freund
Hi, On 2021-04-02 13:42:42 -0700, Zhihong Yu wrote: > I don't see where my_wait_event_info is read (there is no getter method in > the patch). There are no reads via my_wait_event_info. Once connected to shared memory, InitProcess() calls pgstat_set_wait_event_storage() to point it to &MyProc->wa

[PATCH] Implement motd for PostgreSQL

2021-04-02 Thread Joel Jacobson
Dear fellow hackers, This patch is one day late, my apologies for missing the deadline this year. PostgreSQL has since long been suffering from the lack of a proper UNIX style motd (message of the day). DBAs have no ways of conveying important information to users, having to rely on external pr

Re: [PATCH] Implement motd for PostgreSQL

2021-04-02 Thread Chapman Flack
On 04/02/21 16:46, Joel Jacobson wrote: > __ ___ > /)/ / > ( / ___) > (/ o) ( o) ) >_ (_ )) / >/_/)_/ > / //| |\ > v | | v > __/ Slonik's backslashes are falling off. Eww. Regards, -Chap

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread John W Higgins
On Fri, Apr 2, 2021 at 11:05 AM Bruce Momjian wrote: > On Thu, Apr 1, 2021 at 09:46:58PM -0700, Bryn Llewellyn wrote: > > Or am I misunderstanding something? > > > > Try this. The result of each “select” is shown as the trailing comment > on the > > same line. I added whitespace by hand to line

Re: Bug? pg_identify_object_as_address() et al doesn't work with pg_enum.oid

2021-04-02 Thread Andrew Dunstan
On 3/30/21 3:08 PM, Joel Jacobson wrote: > Hi, > > Some catalog oid values originate from other catalogs, > such as pg_aggregate.aggfnoid -> pg_proc.oid > or pg_attribute.attrelid -> pg_class.oid. > > For such oid values, the foreign catalog is the regclass > which should be passed as the first a

Re: [PATCH] Implement motd for PostgreSQL

2021-04-02 Thread Marko Tiikkaja
Hi Joel On Fri, Apr 2, 2021 at 11:47 PM Joel Jacobson wrote: > PostgreSQL has since long been suffering from the lack of a proper UNIX > style motd (message of the day). > First of all, thanks for your work on this! I think this is an important feature to have, but I would love to see a way t

Re: policies with security definer option for allowing inline optimization

2021-04-02 Thread Dan Lynch
My goal is to use RLS for everything, including SELECTs, so it's super important to consider every performance tweak possible. Appreciate any insights or comments. I'm also hoping to document this better for application developers who want to use postgres and RLS. Does anyone know details of, or w

Re: [PATCH] Implement motd for PostgreSQL

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 10:46:16PM +0200, Joel Jacobson wrote: > Dear fellow hackers, > > This patch is one day late, my apologies for missing the deadline this year. Uh, the deadline for the last commitfest was March 1, 2021, not April 1. -- Bruce Momjian https://momjian.us EDB

Re: Using COPY FREEZE in pgbench

2021-04-02 Thread Peter Geoghegan
On Sun, Mar 21, 2021 at 5:23 PM Tatsuo Ishii wrote: > Anyway, this time total pgbench time is reduced by 14% over all > here. I hope people agree that the patch is worth the gain. Most of the time when I run pgbench I use my own shell script, which does this: PGOPTIONS='-c vacuum_freeze_min_age=

Re: libpq debug log

2021-04-02 Thread Alvaro Herrera
On 2021-Apr-02, Tom Lane wrote: > Alvaro Herrera writes: > > As in the attached patch. > > +1, but the comment could be more specific. Maybe like "In regress mode, > suppress the length of ErrorResponse and NoticeResponse messages --- the F > (file name) field, in particular, can vary in length

Re: libpq debug log

2021-04-02 Thread Tom Lane
Alvaro Herrera writes: > On 2021-Apr-02, Tom Lane wrote: >> +1, but the comment could be more specific. Maybe like "In regress mode, >> suppress the length of ErrorResponse and NoticeResponse messages --- the F >> (file name) field, in particular, can vary in length depending on compiler >> used.

Re: SP-GiST confusion: indexed column's type vs. index column type

2021-04-02 Thread Tom Lane
Peter Geoghegan writes: > On Fri, Apr 2, 2021 at 9:37 AM Tom Lane wrote: >> I propose changing things so that >> (A) attType really is the input (heap) data type. >> (B) We enforce that leafType agrees with the opclass opckeytype, >> ensuring the index tupdesc can be used for leaf tuples. >> (C)

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 01:05:42PM -0700, Bryn Llewellyn wrote: > I should come clean about the larger context. I work for Yugabyte, Inc. We > have > a distributed SQL database that uses the Version 11.2 PostgreSQL C code for > SQL > processing “as is”. > > https://blog.yugabyte.com/ > distribut

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 01:27:33PM -0700, Zhihong Yu wrote: > Bruce: > Thanks for tackling this issue. > > The patch looks good to me. > When you have time, can you include the places which were not covered by the > current diff ? I have just posted a new version of the patch which I think covers

Re: Any objections to implementing LogicalDecodeMessageCB for pgoutput?

2021-04-02 Thread Euler Taveira
On Thu, Apr 1, 2021, at 7:19 AM, Amit Kapila wrote: > Your ideas/suggestions look good to me. Don't we need to provide a > read function corresponding to logicalrep_write_message? We have it > for other write functions. Can you please combine all of your changes > into one patch? Thanks for taking

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 02:00:03PM -0700, John W Higgins wrote: > On Fri, Apr 2, 2021 at 11:05 AM Bruce Momjian wrote: > While maybe there is an argument to fixing the negative/positive rounding > issue > - there is no way this gets solved without breaking the current implementation > > select i

Re: Using COPY FREEZE in pgbench

2021-04-02 Thread Tatsuo Ishii
> Most of the time when I run pgbench I use my own shell script, which does > this: > > PGOPTIONS='-c vacuum_freeze_min_age=0 -c wal_compression=off' pgbench > -i -s $SCALE > > Have you considered this case? In other words, have you considered the > benefits of this patch for users that currentl

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Zhihong Yu
Hi, bq. My new code returns 0.2 months for this, not zero Can you clarify (the output below that was 2 mons, not 0.2) ? Thanks On Fri, Apr 2, 2021 at 4:58 PM Bruce Momjian wrote: > On Fri, Apr 2, 2021 at 02:00:03PM -0700, John W Higgins wrote: > > On Fri, Apr 2, 2021 at 11:05 AM Bruce Momjian

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 07:47:32PM -0400, Bruce Momjian wrote: > I have modified the patch to prevent partial months from creating > partial hours/minutes/seconds, so the output is now at least consistent > based on the three units: > > SELECT ('6.54321 years'::interval)::text as i; >

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bryn Llewellyn
br...@momjian.us wrote: > I have just posted a new version of the patch which I think covers all the > right areas. I found the relevant email from you to pgsql-hackers here: https://www.postgresql.org/message-id/20210402234732.GA29125%40momjian.us You said: > I have modified the patch to pre

Re: TRUNCATE on foreign table

2021-04-02 Thread Kazutaka Onishi
All, Thank you for discussion. I've updated the patch (v6->v7) according to the conclusion. I'll show the modified points: 1. Comments for ExecuteTuncate() 2. Replacing extra value in frels_extra with integer to label. 3. Skipping XLOG_HEAP_TRUNCATE on foreign table Regards, 2021年4月2日(金) 11:44

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 05:50:59PM -0700, Bryn Llewellyn wrote: > are the user’s parameterization. All are real numbers. Because non-integral > values for years, months, days, hours, and minutes are allowed when you > specify > a value using the ::interval typecast, my reference doc must state the

Re: Using COPY FREEZE in pgbench

2021-04-02 Thread Peter Geoghegan
On Fri, Apr 2, 2021 at 4:58 PM Tatsuo Ishii wrote: > I am not sure how many people use this kind of options while running > pgbench -i but we could add yet another switch to fall back to none > FREEZE COPY if you want. I was unclear. What I meant was that your patch isn't just useful because it s

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Zhihong Yu
Hi, I got a local build with second patch where: yugabyte=# SELECT interval '0.3 years' + interval '0.4 years' - interval '0.7 years'; ?column? -- 1 mon I think the outcome is a bit unintuitive (I would expect result close to 0). Cheers On Fri, Apr 2, 2021 at 5:07 PM

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Isaac Morland
On Fri, 2 Apr 2021 at 21:08, Zhihong Yu wrote: > Hi, > I got a local build with second patch where: > > yugabyte=# SELECT interval '0.3 years' + interval '0.4 years' - > interval '0.7 years'; > ?column? > -- > 1 mon > > I think the outcome is a bit unintuitive (I would

Re: Using COPY FREEZE in pgbench

2021-04-02 Thread Tatsuo Ishii
> I was unclear. What I meant was that your patch isn't just useful > because it speeds up "pgbench -i" for everybody. It's also useful > because having all of the tuples already frozen after bulk loading > seems like a good benchmarking practice, at least most of the time. > > The patch changes t

Re: Data type correction in pgstat_report_replslot function parameters

2021-04-02 Thread vignesh C
On Fri, Apr 2, 2021 at 1:59 PM Fujii Masao wrote: > > > > On 2021/04/02 11:20, vignesh C wrote: > > On Thu, Apr 1, 2021 at 11:18 PM Fujii Masao > > wrote: > >> > >> > >> > >> On 2021/04/02 2:18, Jeevan Ladhe wrote: > >>> > >>> > >>> On Thu, Apr 1, 2021 at 10:20 PM vignesh C >>>

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Zhihong Yu
Hi, The mix of interval and comparison with float is not easy to interpret. See the following (I got 0.0833 since the result for interval '0.3 years' + interval '0.4 years' - ... query was 1 month and 1/12 ~= 0.0833). yugabyte=# select 0.3 * '1 year'::interval + 0.4 * '1 year'::interval - 0.7 * '1

Re: SP-GiST confusion: indexed column's type vs. index column type

2021-04-02 Thread Tom Lane
I wrote: > Also, both the code and docs thought that the "reconstructedValue" > datums that are passed down the tree during a search should be of > the leaf data type. This seems to me to be arrant nonsense. > As an example, if you made an opclass that indexes 1-D arrays > by labeling each inner n

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 06:11:08PM -0700, Zhihong Yu wrote: > Hi, > I got a local build with second patch where: > > yugabyte=# SELECT  interval '0.3 years' + interval '0.4 years' - >                 interval '0.7 years'; >  ?column? > -- >  1 mon > > I think the outcome is a bit unintuit

Re: Have I found an interval arithmetic bug?

2021-04-02 Thread Bruce Momjian
On Fri, Apr 2, 2021 at 07:06:08PM -0700, Zhihong Yu wrote: > Hi, > The mix of interval and comparison with float is not easy to interpret. See > the > following (I got 0.0833 since the result for interval '0.3 years' + interval > '0.4 years' - ... query was 1 month and 1/12 ~= 0.0833). > > yugab

Re: [PATCH] Implement motd for PostgreSQL

2021-04-02 Thread Michael Paquier
On Fri, Apr 02, 2021 at 10:46:16PM +0200, Joel Jacobson wrote: > Ascii elephant in example by Michael Paquier [1], with ANSI colors added by > me. > > [1] > https://www.postgresql.org/message-id/CAB7nPqRaacwcaANOYY3Hxd3T0No5RdZXyqM5HB6fta%2BCoDLOEg%40mail.gmail.com The credit here goes to Charl

  1   2   >