Re: Refactoring HMAC in the core code

2020-12-17 Thread Michael Paquier
On Fri, Dec 18, 2020 at 08:41:01AM +0900, Michael Paquier wrote: > Knowing that we are in a period of vacations for a lot of people, and > that this is a sensitive area of the code that involves > authentication, I think that it is better to let this thread brew > longer and get more

Incorrect allocation handling for cryptohash functions with OpenSSL

2020-12-17 Thread Michael Paquier
nothing gets forgotten or cleaned up on the way until the resowner that did the cryptohash allocation is handled. Attached is a small extension I have played with by doing some error injections, and a patch. If there are no objections, I would like to commit this fix. Thanks, -- Michael diff --git

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2020-12-18 Thread Michael Paquier
now about the resowner dependency only in the OpenSSL part of cryptohashes, without having to include this knowledge in neither cryptohash.h nor in the fallback implementation that can just use palloc() in the backend. -- Michael signature.asc Description: PGP signature

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2020-12-18 Thread Michael Paquier
On Fri, Dec 18, 2020 at 11:51:55AM +0200, Heikki Linnakangas wrote: > Something like this. Passes regression tests, but otherwise untested. ... And I wanted to keep track of the type of cryptohash directly in the shared structure. ;) -- Michael signature.asc Description: PGP signature

Re: Refactoring HMAC in the core code

2020-12-18 Thread Michael Paquier
eed to rush for this stuff. I would rather wait more and make sure that we agree on an interface people are happy enough with. -- Michael signature.asc Description: PGP signature

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2020-12-18 Thread Michael Paquier
r codes for the init, update and final but it is possible to grab for errors then react on that). And we have even in our tree code paths a-la-pgcrypto that have callbacks for each phase with some processing in-between. HMAC also gets a bit cleaner by keeping this flexibility IMO. -- Michael signature.asc Description: PGP signature

Re: Commit fest manager for 2021-01

2020-12-18 Thread Michael Paquier
On Sat, Dec 19, 2020 at 10:03:47AM +0530, Amit Kapila wrote: > Glad to hear. I am confident that you can do justice to this role. I also think you will do just fine. Thanks for taking care of this. -- Michael signature.asc Description: PGP signature

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2020-12-18 Thread Michael Paquier
ment from upthread to return a failure if the caller passes NULL for the context, and adjusted some comments. What do you think of the attached? -- Michael diff --git a/src/include/common/cryptohash.h b/src/include/common/cryptohash.h index 6ead1cb8e5..817e07c9a2 100644 --- a/src/include/common/cr

Re: Refactor routine to check for ASCII-only case

2020-12-20 Thread Michael Paquier
On Fri, Dec 18, 2020 at 11:30:16AM -0500, Stephen Frost wrote: > * Heikki Linnakangas (hlinn...@iki.fi) wrote: >> +1 > > Yeah, in a quick look, this looks like a good improvement. Thanks. This has been applied as of 93e8ff8. -- Michael signature.asc Description: PGP signature

Re: Dependency isn't created between extension and schema

2020-12-20 Thread Michael Paquier
extension allows its contents to be relocated. The named schema must already exist. While on it.. The docs are incorrect here. As you say, CreateExtensionInternal() may internally create a schema. -- Michael signature.asc Description: PGP signature

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-21 Thread Michael Paquier
On Wed, Dec 16, 2020 at 10:01:11AM +0900, Michael Paquier wrote: > On Tue, Dec 15, 2020 at 09:45:17PM -0300, Alvaro Herrera wrote: > > I don't like this idea too much, because adding an option causes an ABI > > break. I don't think we commonly add options in backbranches

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-22 Thread Michael Paquier
hat CTAS or CREATE MATVIEW will never ERROR if the relation already exists, with or without EXPLAIN, EXECUTE or WITH NO DATA, so that gets us a consistent behavior across all the patterns. Note: I'd like to think that we could choose a better name for CheckRelExistenceInCTAS(). -- Michael From 6

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-22 Thread Michael Paquier
ntexts. Forgot that in the previous version actually. -- Michael diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h index c041628049..89394b648e 100644 --- a/src/include/catalog/index.h +++ b/src/include/catalog/index.h @@ -30,13 +30,16 @@ typedef enum } IndexStateFlags

Cleanup some -I$(libpq_srcdir) in makefiles

2020-12-22 Thread Michael Paquier
l-ish cleanup that removes those references, as per the attached? Thanks, -- Michael diff --git a/contrib/adminpack/Makefile b/contrib/adminpack/Makefile index 630fea7726..851504f4ae 100644 --- a/contrib/adminpack/Makefile +++ b/contrib/adminpack/Makefile @@ -4,7 +4,6 @@ MODULE_big = adminpack

Re: Reduce the number of special cases to build contrib modules on windows

2020-12-22 Thread Michael Paquier
On Tue, Dec 22, 2020 at 11:24:40PM +1300, David Rowley wrote: > On Wed, 11 Nov 2020 at 13:44, Michael Paquier wrote: >> It seems to me that your patch is doing the right thing for adminpack >> and that its Makefile has no need to include a reference to libpq >> source path, n

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-22 Thread Michael Paquier
eindex() will set options.tablespaceOid, not a pointer. Like > this. OK. Good to know, I have not looked at this part of the patch yet. -- Michael diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h index c041628049..89394b648e 100644 --- a/src/include/catalog/index.h +++ b/src/include/catal

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Michael Paquier
On Tue, Dec 22, 2020 at 03:12:15PM +0530, Bharath Rupireddy wrote: > On Tue, Dec 22, 2020 at 2:07 PM Michael Paquier wrote: >> Note: I'd like to think that we could choose a better name for >> CheckRelExistenceInCTAS(). > > I changed it to IsCTASRelCreationAllowed

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Michael Paquier
ass down a new option. > No ; that was from an earlier revision of the patch adding the tablespace, > before Michael suggested a ReindexOptions struct, which subsumes 'options' and > 'tablespaceOid'. > > I see now that 'skip_constraint_checks' is fro

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Michael Paquier
until the period of vacations is over before wrapping this up to give others the occasion to comment. -- Michael signature.asc Description: PGP signature

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2020-12-23 Thread Michael Paquier
On Thu, Dec 24, 2020 at 10:50:34AM +0900, Michael Paquier wrote: > FWIW, it still makes the most sense to me to keep the options that are > extracted from the grammar or things that apply to all the > sub-routines of REINDEX to be tracked in a single structure, so this > should incl

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-23 Thread Michael Paquier
ions is over before wrapping this up to give others the >> occasion to comment. > > Thanks! Happy Vacations! You too! -- Michael signature.asc Description: PGP signature

Re: doc review for v14

2020-12-24 Thread Michael Paquier
ed_memory is affected by > the huge_pages setting on operating systems where > that is supported, and may be more likely to benefit from larger > pages > on operating systems where that is managed automatically. The current formulation is not that confusing

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2020-12-24 Thread Michael Paquier
d either, as we should avoid incorrect computations or crash on OOM, not to mention that this would fail the detection of bugs coming directly from OpenSSL or any other SSL library this code plugs with. In short, I think that there are more benefits in letting the caller control the error handling

Re: Feature request: Connection string parsing for postgres_fdw

2020-12-24 Thread Michael Paquier
tension, though this is not really something related to postgres_fdw. Or just refactor the code into src/common/ and then consume the refactored pieces from libpq and the backend. -- Michael signature.asc Description: PGP signature

Re: Commit fest manager for 2021-01

2020-12-24 Thread Michael Paquier
utton at the top. From there, you should be able to control the status of all the existing commit fest and patches. -- Michael signature.asc Description: PGP signature

Re: create table like: ACCESS METHOD

2020-12-24 Thread Michael Paquier
Second sentence sounds a bit strange by combining "the" and a GUC name. I would just write "Default is default_table_a_m". -- Michael signature.asc Description: PGP signature

Re: Disable WAL logging to speed up data loading

2020-12-24 Thread Michael Paquier
with a cheap succession of commands by loading the data in a transaction done after a TRUNCATE? [1]: https://www.postgresql.org/message-id/20201001.115136.288898409051085426.horikyota@gmail.com [2]: https://www.postgresql.org/docs/current/populate.html#POPULATE-COPY-FROM -- Michael signature.asc Description: PGP signature

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-24 Thread Michael Paquier
e partitions inherit > that value. That's indeed more interesting from the user perspective. So +1 from me. -- Michael signature.asc Description: PGP signature

Re: [bug fix] ALTER TABLE SET LOGGED/UNLOGGED on a partitioned table does nothing silently

2020-12-24 Thread Michael Paquier
isted in the CF for this thread: https://commitfest.postgresql.org/31/2857/ And it seems to me that waiting on author is most appropriate here, so I have changed the entry to reflect that. -- Michael signature.asc Description: PGP signature

Re: Improper use about DatumGetInt32

2020-12-24 Thread Michael Paquier
e signature (pg_stat_statements_1_8 et al). With the 1.8 flavor, it is possible to pass down a negative number and it may not fail depending on the number of blocks of the relation, so I think that you had better have a compatibility layer if a user has the new binaries but is still on 1.8.

Re: Commit fest manager for 2021-01

2020-12-24 Thread Michael Paquier
permissions of the app, but if that proves to be necessary I am fine to switch the CF status. Just let me know if you want me to do so when the time comes. -- Michael signature.asc Description: PGP signature

Re: doc review for v14

2020-12-28 Thread Michael Paquier
I don't really know if I should act on it or not :) -- Michael signature.asc Description: PGP signature

Re: doc review for v14

2020-12-28 Thread Michael Paquier
On Tue, Dec 29, 2020 at 01:59:58PM +1300, Thomas Munro wrote: > LGTM. Thanks, I have done this one then. -- Michael signature.asc Description: PGP signature

Re: doc review for v14

2020-12-29 Thread Michael Paquier
t, I have included catalogs.sgml, pgstatstatements.sgml, explain.sgml, pg_verifybackup.sgml and wal.sgml in 13. > doc/src/sgml/cube.sgml? > doc/src/sgml/func.sgml? These two are some beautification for the format of the function, so I have left them out. -- Michael signature.asc Description: PGP signature

Weird failure in explain.out with OpenBSD

2020-12-29 Thread Michael Paquier
tion Time: N.N ms + Execution Time: -N.N ms (3 rows) Not sure what to think about that, as this implies the calculation of a negative execution time. Regards, -- Michael signature.asc Description: PGP signature

Re: Cleanup some -I$(libpq_srcdir) in makefiles

2020-12-29 Thread Michael Paquier
; > since this Makefile has never actually linked libpq, it's hard to see why > it'd be useful here. Thanks David and Tom. I got around to apply this cleanup. -- Michael signature.asc Description: PGP signature

Re: Weird failure in explain.out with OpenBSD

2020-12-29 Thread Michael Paquier
ee that this looks like a monotonic clock going backwards. Or could it be possible that it gave 0.0 as result, still a minus sign was appended? That would mean an execution that took less than 1us per the system clock. -- Michael signature.asc Description: PGP signature

Re: [PATCH] Simplify permission checking logic in user.c

2020-12-29 Thread Michael Paquier
, no? Your change also means that we may call superuser() more times than necessary, but last_roleid_is_super leverages that, and this code path is not performance-critical either. I am adding Stephen in CC, just in case he has some comments to share. -- Michael signature.asc Description: PGP signature

Re: Fail Fast In CTAS/CMV If Relation Already Exists To Avoid Unnecessary Rewrite, Planning Costs

2020-12-30 Thread Michael Paquier
On Thu, Dec 24, 2020 at 01:23:40PM +0900, Michael Paquier wrote: > Please note that I have added an entry in the CF app for the moment so > as we don't lose track of it: > https://commitfest.postgresql.org/31/2892/ I have been able to look at that again today, and applied it. I

Re: Disable WAL logging to speed up data loading

2020-12-30 Thread Michael Paquier
Do you have some references? Just a matter of curiosity :) -- Michael signature.asc Description: PGP signature

Re: Moving other hex functions to /common

2020-12-30 Thread Michael Paquier
#x27;s just necessary for the decode routine that's the only thing using get_hex(). - Let's prefix the routines in src/common/ with "pg_", to be consistent with base64. - It would be good to document the top each routine in hex.c (see base64.c for a similar reference). -- Michael signature.asc Description: PGP signature

[PATCH] New default role allowing to change per-role/database settings

2020-12-31 Thread Michael Banck
ion, or does anybody see a big problem with that (compared to the others in that set)? I initially pondered not introducing a new context but just filtering on category, but as categories seem to be only descriptive in guc.c and not used for any policy decisions so far, I have abandoned this pretty qui

Re: [Doc Patch] Clarify that CREATEROLE roles can GRANT default roles

2020-12-31 Thread Michael Banck
Hi, Am Montag, den 28.12.2020, 20:41 +0900 schrieb Masahiko Sawada: > On Sat, Nov 28, 2020 at 7:50 AM Michael Banck > wrote: > > https://www.postgresql.org/docs/current/default-roles.html mentions the > > "Administrator" several times, but does not specify it furth

Move --data-checksums to common options in initdb --help

2021-01-01 Thread Michael Banck
checksums these days that it warrants to be moved into the "normal part", like in the attached. Michael -- Michael Banck Projektleiter / Senior Berater Tel.: +49 2166 9901-171 Fax: +49 2166 9901-100 Email: michael.ba...@credativ.de credativ GmbH, HRB Mönchengladbach 12080 USt

Re: Moving other hex functions to /common

2021-01-01 Thread Michael Paquier
TH is a good idea either, I'd like to get rid of it in the long-term) and ECPG, so that's clearly a gain. I don't have a Windows host at hand, though I think that it should work there correctly. What do you think about the ideas in the attached patch? -- Michael From 8952fb2d5e5a7a0

Re: Move --data-checksums to common options in initdb --help

2021-01-01 Thread Michael Paquier
On Fri, Jan 01, 2021 at 08:34:34PM +0100, Michael Banck wrote: > I think enough people use data checksums these days that it warrants to > be moved into the "normal part", like in the attached. +1. Let's see first what others think about this change. -- Michael signature

Re: doc review for v14

2021-01-02 Thread Michael Paquier
On Tue, Dec 29, 2020 at 06:22:43PM +0900, Michael Paquier wrote: > Yes, I have done an extra effort on those fixes where needed. On top > of that, I have included catalogs.sgml, pgstatstatements.sgml, > explain.sgml, pg_verifybackup.sgml and wal.sgml in 13. Justin, I got to look at th

Re: doc review for v14

2021-01-03 Thread Michael Paquier
) xtCxt->xmlerrcxt, > xml_errorHandler); I quite like your suggestion to be a maximum simple here, and the docs of upstream also give a lot of context: http://xmlsoft.org/html/libxml-xmlerror.html#xmlSetStructuredErrorFunc So let's use this version and call it a day for this part. -- Michae

data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-04 Thread Michael Banck
Heya, (changing the subject as we're moving the goalposts) Am Samstag, den 02.01.2021, 10:47 -0500 schrieb Stephen Frost: > * Michael Paquier (mich...@paquier.xyz) wrote: > > On Fri, Jan 01, 2021 at 08:34:34PM +0100, Michael Banck wrote: > > > I think enough people use da

Re: Moving other hex functions to /common

2021-01-04 Thread Michael Paquier
e case you are looking for frontend tools able to do logging. Merging ECPG and the backend requires switching to a logic where we return more than one error code so we could just use an enum for the result result à-la-PQping like in libpq. -- Michael signature.asc Description: PGP signature

Re: Track replica origin progress for Rollback Prepared

2021-01-04 Thread Michael Paquier
ou may want to document as a comment the reason why this gets sent even if (wal_level < logical). -- Michael signature.asc Description: PGP signature

Re: pg_rewind restore_command issue in PG12

2021-01-04 Thread Michael Paquier
etched on startup by configuring primary_conninfo or restore_command." ("or fetched on startup by configuring recovery.conf" in some older branches). This confusion has been introduced by 878bd9a, down to 9.6. Heikki, what do you think? -- Michael signature.asc Description: PGP signature

Re: Online checksums patch - once again

2021-01-05 Thread Michael Banck
nline activation of checksusm, so could pretty much be committed verbatim right now, except for the "either as an offline operation or in a running cluster" bit which would have to be rewritten. > + > + > + Off-line Enabling of Checksums > + > + > +The linkend="app-

Re: Online checksums patch - once again

2021-01-05 Thread Michael Banck
DatachecksumsWorkerShmem->target = enable_checksums; This one is especially confusing as it looks like we're unconditionally enabling checksums but instead we're just setting the target based on the bool (see above). It might be our standard notation though. [...] > +/* &

Re: doc review for v14

2021-01-05 Thread Michael Paquier
On Sun, Jan 03, 2021 at 09:05:09PM +0900, Michael Paquier wrote: > So let's use this version and call it a day for this part. This has been done as of b49154b. -- Michael signature.asc Description: PGP signature

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-05 Thread Michael Paquier
On Mon, Jan 04, 2021 at 07:11:43PM +0100, Michael Banck wrote: > Am Samstag, den 02.01.2021, 10:47 -0500 schrieb Stephen Frost: >> * Michael Paquier (mich...@paquier.xyz) wrote: >>> On Fri, Jan 01, 2021 at 08:34:34PM +0100, Michael Banck wrote: >>> > I think enough p

Re: Moving other hex functions to /common

2021-01-05 Thread Michael Paquier
nto shared libs is fine by me at the end because we don't have a case for libpq yet, but I object to the lack of protection against overflows. -- Michael signature.asc Description: PGP signature

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-05 Thread Michael Banck
Hi, Am Mittwoch, den 06.01.2021, 10:52 +0900 schrieb Michael Paquier: > On Mon, Jan 04, 2021 at 07:11:43PM +0100, Michael Banck wrote: > > So maybe we should switch on wal_compression if we enable data checksums > > by default. > > I don't agree with this assump

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2021-01-06 Thread Michael Paquier
On Sat, Dec 19, 2020 at 03:13:50PM +0900, Michael Paquier wrote: > At the same time, I have taken care of your comment from upthread to > return a failure if the caller passes NULL for the context, and > adjusted some comments. What do you think of the attached? I have looked agai

Re: Track replica origin progress for Rollback Prepared

2021-01-06 Thread Michael Paquier
Dump transaction origin information only for > abort prepared. We need this during recovery to update the replication > origin progress."? That sounds fine. -- Michael signature.asc Description: PGP signature

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-06 Thread Michael Banck
Hi, On Wed, Jan 06, 2021 at 09:55:08AM -0800, Andres Freund wrote: > On 2021-01-06 12:02:40 -0500, Stephen Frost wrote: > > * Andres Freund (and...@anarazel.de) wrote: > > > On 2021-01-04 19:11:43 +0100, Michael Banck wrote: > > > > This looks much better from the

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-06 Thread Michael Banck
instance around handily right now to check. Micael -- Michael Banck Projektleiter / Senior Berater Tel.: +49 2166 9901-171 Fax: +49 2166 9901-100 Email: michael.ba...@credativ.de credativ GmbH, HRB Mönchengladbach 12080 USt-ID-Nummer: DE204566209 Trompeterallee 108, 41189 Mönchengladbach Gesc

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-06 Thread Michael Banck
Am Mittwoch, den 06.01.2021, 19:07 +0100 schrieb Michael Banck: > Am Mittwoch, den 06.01.2021, 09:58 -0800 schrieb Andres Freund: > > It still requires running a binary locally on the DB server, no? Which > > means it'll not be an option on most cloud providers... > > A

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-06 Thread Michael Banck
RDS use --data-checksums during > initdb? At least data_checksums=on for Azure Managed Postgres, Amazon RDS and Google Cloud SQL Postgres. It might not be on for all types (I just checked the basic one each earlier today), but I guess it is. Michael -- Michael Banck Projektleiter /

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-06 Thread Michael Banck
Am Mittwoch, den 06.01.2021, 13:08 -0800 schrieb Peter Geoghegan: > On Wed, Jan 6, 2021 at 1:04 PM Michael Banck > wrote: > > At least data_checksums=on for Azure Managed Postgres, Amazon RDS and > > Google Cloud SQL Postgres. It might not be on for all types (I just > &g

Re: data_checksums enabled by default (was: Move --data-checksums to common options in initdb --help)

2021-01-06 Thread Michael Banck
s 1GB for the smallest possible one and 32GB for a production instance. It's 1GB for the small Google Cloud SQL Postgres and 2GB for the small RDS test instance. It is user-changeable everywhere (at least to some degree). Michael -- Michael Banck Projektleiter / Senior Berater Tel.: +49

Re: Some more hackery around cryptohashes (some fixes + SHA1)

2021-01-06 Thread Michael Paquier
On Mon, Dec 14, 2020 at 12:48:15PM +0900, Michael Paquier wrote: > This is a nice cleanup, so I have moved ahead and applied it. A > rebased version of the SHA1 business is attached. Rebased version attached to address the conflicts caused by 55fe26a. I have fixed three places in pgcrypto

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2021-01-06 Thread Michael Paquier
On Wed, Jan 06, 2021 at 03:27:03PM +0200, Heikki Linnakangas wrote: > Looks fine to me. Thanks, I have been able to get this part done as of 55fe26a. -- Michael signature.asc Description: PGP signature

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2021-01-06 Thread Michael Paquier
l except if we use more switch/case to set up the various variables. What about something like the attached? -- Michael diff --git a/src/include/common/checksum_helper.h b/src/include/common/checksum_helper.h index ebdf1ccf44..cac7570ea1 100644 --- a/src/include/common/checksum_helper.h +++ b/s

Re: pg_rewind restore_command issue in PG12

2021-01-07 Thread Michael Paquier
On Tue, Jan 05, 2021 at 11:54:42AM +0300, Amine Tengilimoglu wrote: > Thank you Michael. I agree with you. Relevant part can be removed from the > document and eliminate the confusion at least. Okay, I got around this stuff, and committed a fix for 9.6~12. Thanks for the report,

Re: Online checksums patch - once again

2021-01-07 Thread Michael Banck
Hi, On Thu, Jan 07, 2021 at 03:05:44PM +0100, Daniel Gustafsson wrote: > > On 5 Jan 2021, at 18:19, Michael Banck wrote: > >> + > >> + Data pages are not checksum protected by default, but this can > >> optionally be > >> + enabled for a cluster.

Re: Incorrect allocation handling for cryptohash functions with OpenSSL

2021-01-07 Thread Michael Paquier
ink more about that. >> Using separate fields looked cleaner to me if it came to debugging, >> and the cleanup was rather minimal except if we use more switch/case >> to set up the various variables. What about something like the >> attached? > > +1 Thanks, I have com

Re: Refactoring HMAC in the core code

2021-01-07 Thread Michael Paquier
On Fri, Dec 18, 2020 at 03:46:42PM +0900, Michael Paquier wrote: > This has been tested on Windows and Linux across all the versions of > OpenSSL we support on HEAD. I am also attaching a small module called > hmacfuncs that I used as a way to validate this patch across all the >

Re: Improper use about DatumGetInt32

2021-01-08 Thread Michael Paquier
sentences? Maybe something like "invalid block number %u referring to meta page" and "block number out of range for relation %s: %llu"? -- Michael signature.asc Description: PGP signature

Fix \watch if expanded output is on and there are no results

2021-01-09 Thread Michael Banck
On the ohter hand, we're just returning early from print_aligned_vertical() right now and never get to the part where we usually print the title if there are zero results. Michael -- Michael Banck Projektleiter / Senior Berater Tel.: +49 2166 9901-171 Fax: +49 2166 9901-100 Email: micha

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-12 Thread Michael Paquier
down result_size() and down to the cryptohash functoins, meaning that there is no need to take about it more than that IMO. The second one would be tied to the HMAC refactoring. This would be valuable in the case of pgcrypto when building with OpenSSL, meaning that the code would go through the

Re: some pointless HeapTupleHeaderIndicatesMovedPartitions calls

2021-02-12 Thread Michael Paquier
h is: Ready for Committer So that's this patch: https://commitfest.postgresql.org/32/2941/. Alvaro is most likely going to take care of that, so let's wait for him. -- Michael signature.asc Description: PGP signature

Re: Tightening up allowed custom GUC names

2021-02-12 Thread Michael Paquier
On Thu, Feb 11, 2021 at 02:50:13PM -0500, Robert Haas wrote: > +1 for not back-patching whatever we do here. +1. -- Michael signature.asc Description: PGP signature

Re: Possible dereference null return (src/backend/replication/logical/reorderbuffer.c)

2021-02-12 Thread Michael Paquier
creating a bogus rbtxn. THus it is wrong to set create=true and > create_as_top=true. We could change the assertion like Assert (txn && > txn->base_snapshot) to make things clearer. I don't see much the point to change this code. The result would be the same: a PANIC at th

Re: [DOC] add missing "[ NO ]" to various "DEPENDS ON" synopses

2021-02-12 Thread Michael Paquier
gram.y, and you are covering all of them. So this looks good to me. I'll apply and backpatch in a bit. It is worth noting that tab-complete.c does a bad job in completing those clauses. -- Michael signature.asc Description: PGP signature

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-13 Thread Michael Paquier
In short, any *future* potential bug fix that would require to be backpatched in need of using this function or touching its area would result in a conflict. This changes makes no sense. -- Michael signature.asc Description: PGP signature

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-14 Thread Michael Paquier
On Sat, Feb 13, 2021 at 09:33:48PM -0300, Ranier Vilela wrote: > Em sáb., 13 de fev. de 2021 às 20:32, Michael Paquier > escreveu: > >> You are missing the point here. What you are proposing here would not >> be backpatched. However, reusing the same words as upthread,

Re: How to get Relation tuples in C function

2021-02-14 Thread Michael Paquier
could finish by being inlined, allowing the planner to apply optimizations as it would know the function body. Going with SPI has the advantage to have code able to work without any changes across major versions, which is a no-brainer when it comes to long-term maintenance. -- Michael signature.asc Description: PGP signature

Re: pg_cryptohash_final possible out-of-bounds access (per Coverity)

2021-02-14 Thread Michael Paquier
checksum type is added. I have reviewed my patch this morning, tweaked a comment, and applied it. -- Michael signature.asc Description: PGP signature

Re: GCC warning in back branches

2021-02-14 Thread Michael Paquier
ave patched the top of the function if it were me, btw. -- Michael signature.asc Description: PGP signature

Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly

2021-02-14 Thread Michael Paquier
aves 090_reindexdb.pl, but I was not really convinced that this was worth the extra test cycles (I am aware of the --tablespace option missing in reindexdb, someone I know was trying to get that done for the next CF). -- Michael signature.asc Description: PGP signature

Re: Fallback table AM for relkinds without storage

2021-02-14 Thread Michael Paquier
On Tue, Feb 09, 2021 at 04:27:34PM +0900, Michael Paquier wrote: > Putting sanity checks within all the table_* functions of tableam.h > would not be a good idea, as nothing prevents the call of what's > stored in rel->rd_tableam. I have been playing with this idea, and

Re: ERROR: invalid spinlock number: 0

2021-02-15 Thread Michael Paquier
egrity checks. It seems to me that the first two sentences of this comment should be combined together. -- Michael signature.asc Description: PGP signature

Re: ERROR: invalid spinlock number: 0

2021-02-15 Thread Michael Paquier
of atomics, we would prepare a spinlock for nothing. -- Michael signature.asc Description: PGP signature

Re: Refactoring HMAC in the core code

2021-02-15 Thread Michael Paquier
On Sat, Jan 23, 2021 at 01:43:20PM +0900, Michael Paquier wrote: > Rebased patch is attached wiht SHA1 added as of a8ed6bb. Now that > SHA1 is part of the set of options for cryptohashes, a lot of code of > pgcrypto can be cleaned up thanks to the refactoring done here, but > I am lea

Re: pg_replication_origin_session_setup and superuser

2021-02-15 Thread Michael Paquier
rg/gitweb/?p=postgresql.git;a=commit;h=cc072641d41c55c6aa24a331fc1f8029e0a8d799 While the default is still superuser-only, it becomes possible to grant access to this stuff to other roles that have no need to be superusers. -- Michael signature.asc Description: PGP signature

Re: [DOC] add missing "[ NO ]" to various "DEPENDS ON" synopses

2021-02-15 Thread Michael Paquier
ot;INDEX", MatchAny, "DEPENDS")) - COMPLETE_WITH("ON EXTENSION"); The part, if removed, means that typing "alter index my_index no " is not able to complete with "DEPENDS ON EXTENSION" anymore. So it seems to me that ALTER INDEX got that right, and that the other commands had better do the same. -- Michael signature.asc Description: PGP signature

Re: ERROR: invalid spinlock number: 0

2021-02-15 Thread Michael Paquier
ith a write(0) when starting the backend. There are two of them in proc.c, one in twophase.c. Do you mind if I add an open item for this one? -- Michael signature.asc Description: PGP signature

Re: pg_replication_origin_session_setup and superuser

2021-02-16 Thread Michael Paquier
On Tue, Feb 16, 2021 at 07:54:32AM +, Zohar Gofer wrote: > Thanks. This seems to be the fix we need. > Would it be possible to push it to previous versions? 12 or 13? New features don't go into stable branches, only bug fixes do. And this is not a bug fix, but a feature.

Re: [DOC] add missing "[ NO ]" to various "DEPENDS ON" synopses

2021-02-16 Thread Michael Paquier
discussed as of 1e324cb: https://www.postgresql.org/message-id/caltqxtcogrfevp9uou5vftngsn+vhzuu9+9a0inarfyvohs...@mail.gmail.com Anyway, after sleeping on it, I have just applied your original patch as that's simpler, and will cover the cases people would care for. -- Michael signature.asc Description: PGP signature

Re: ERROR: invalid spinlock number: 0

2021-02-16 Thread Michael Paquier
On Tue, Feb 16, 2021 at 11:47:52PM +0900, Fujii Masao wrote: > On 2021/02/16 15:50, Michael Paquier wrote: >> + /* >> +* Read "writtenUpto" without holding a spinlock. So it may not be >> +* consistent with other WAL receiver's shared variables protec

Re: progress reporting for partitioned REINDEX

2021-02-16 Thread Michael Paquier
command is working on and on which relation the work is currently done. But I am not really sure that we need that as long a we have a VERBOSE option that lets us know via the logs what already happened in a single command. I see no bug here. -- Michael signature.asc Description: PGP signature

Re: progress reporting for partitioned REINDEX

2021-02-16 Thread Michael Paquier
On Wed, Feb 17, 2021 at 12:10:43AM -0600, Justin Pryzby wrote: > On Wed, Feb 17, 2021 at 02:55:04PM +0900, Michael Paquier wrote: >> I see no bug here. > > pg_stat_progress_create_index includes partitions_{done,total} for > CREATE INDEX p, so isn't it strange if it w

Re: pg_collation_actual_version() ERROR: cache lookup failed for collation 123

2021-02-16 Thread Michael Paquier
ons, for objectaddress functions, etc. That would make this patch set simpler, switching get_collation_version_for_oid() to just use a missing_ok argument. And that would be more consistent with the other syscache lookup functions we have here and there in the tree. -- Michael signature.asc Description: PGP signature

Re: cryptohash: missing locking functions for OpenSSL <= 1.0.2?

2021-02-17 Thread Michael Paquier
can use the crypto part properly, as pqsecure_initialize gets only called now when libpq negotiates SSL with the postmaster. It seems to me that we should make sure of a proper reset of the crypto part within pqDropConnection(), while the initialization needs to happen in PQconnectPoll(). -- Michael signature.asc Description: PGP signature

<    1   2   3   4   5   6   7   8   9   10   >