definition of CalculateMaxmumSafeLSN

2022-02-28 Thread Sergei Kornilov
Hello I just spotted in src/include/access/xlog.h: extern XLogRecPtr CalculateMaxmumSafeLSN(void); This function doesn't seem to be used anywhere or even defined? "git grep CalculateMaxmumSafeLSN" shows only this line. Was added in c6550776394e25c1620bc8258427c8f1d448080d "Allow users to limit s

Re:Proposal: array_unique_agg() function

2022-03-01 Thread Sergei Kornilov
Hello select array_agg(distinct mycolumn) from from the very beginning? Even the 7.1 manual describes such a syntax: https://www.postgresql.org/docs/7.1/sql-expressions.html regards, Sergei

Re: Allow some recovery parameters to be changed with reload

2020-12-01 Thread Sergei Kornilov
Hello > OK, so I pushed the patch. Thanks! Thank you! regards, Sergei

Re: pg_stat_statements oddity with track = all

2020-12-02 Thread Sergei Kornilov
Hello > - add a parent_statement_id column that would be NULL for top level queries Will generate too much entries... Every FK for each different delete/insert, for example. But very useful for databases with a lot of stored procedures to find where this query is called. May be new mode track =

Re: pg_stat_statements oddity with track = all

2020-12-03 Thread Sergei Kornilov
Hello > To get an increase in the number of records that means that the same > statement > would appear at top level AND nested level. This seems a corner case with > very low > (neglectible) occurence rate. +1 I think splitting fields into plans_toplevel / plans_nested will be less convenient.

Re: pg_stat_statements oddity with track = all

2020-12-04 Thread Sergei Kornilov
Hello Seems we need also change PGSS_FILE_HEADER. regards, Sergei

Lock level of create table partition of

2020-12-17 Thread Sergei Kornilov
Hello In commit 898e5e3290a72d288923260143930fb32036c00c [1] we lowered the lock level on the parent relation. I found in discussion [2]: > David Rowley recently pointed out that we can modify > CREATE TABLE .. PARTITION OF to likewise not obtain AEL anymore. > Apparently it just requires remov

Re: Allow some recovery parameters to be changed with reload

2020-10-28 Thread Sergei Kornilov
Hello Sorry for late response. >>  > ... but what's the corresponding hazard here, exactly? It doesn't seem >>  > that there's any way in which the decision one process makes affects >>  > the decision the other process makes. There's still a race condition: >>  > it's possible for a walsender >>

Re: Allow some recovery parameters to be changed with reload

2020-11-06 Thread Sergei Kornilov
Hello > Currently when restore_command is not set, archive recovery fails > at the beginning. With the patch, how should we treat the case where > retore_command is reset to empty during archive recovery? We should > reject that change of restore_command? Good point. I think we should reject that

Re: Allow some recovery parameters to be changed with reload

2020-11-06 Thread Sergei Kornilov
Hello > I'm wondering if it's safe to allow restore_command to be emptied during > archive recovery. Even when it's emptied, archive recovery can proceed > by reading WAL files from pg_wal directory. This is the same behavior as > when restore_command is set to, e.g., /bin/false. I am always conf

Re: Allow some recovery parameters to be changed with reload

2020-11-10 Thread Sergei Kornilov
Hello > If someone changes restore_command to '' then reload while crash > recovery is running, the server stops for no valid reason. While *crash* recovery is running? It's possible only during Point-in-Time Recovery, no? At the beginning of validateRecoveryParameters we check ArchiveRecoveryR

Re: Allow some recovery parameters to be changed with reload

2020-11-10 Thread Sergei Kornilov
Hello > Even if PITR is commanded, crash recovery can run before starting > archive recovery if the server was not gracefully shut down. Hmm... Still not sure how it's possible. Both readRecoverySignalFile and validateRecoveryParameters are called early in StartupXLOG. If PITR was commanded - w

Re: Allow some recovery parameters to be changed with reload

2020-11-11 Thread Sergei Kornilov
Hello > Anyway, for now I think that your first patch would be enough, i.e., > just change the context of restore_command to PGC_SIGHUP. Glad to hear. Attached a rebased version of the original proposal. regards, Sergeidiff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index f04343

​generated columns in MergeAttributesIntoExisting

2020-11-12 Thread Sergei Kornilov
Hello I found a simple test case: CREATE TABLE test(id int NOT NULL, gen int GENERATED ALWAYS AS (id + 1) STORED) partition by range (id); create table test_part_create partition of test for values from ( 0) to (10); create table test_part_attach (id int NOT NULL, gen int); alter table test atta

Re: Improve handling of parameter differences in physical replication

2020-11-19 Thread Sergei Kornilov
Hello Thank you! I'm on vacation, so I was finally able to review the patch. Seems WAIT_EVENT_RECOVERY_PAUSE addition was lost during patch simplification. > ereport(FATAL, > (errmsg("recovery aborted because of > insufficient parameter settings"), >

Re: Improve handling of parameter differences in physical replication

2020-11-20 Thread Sergei Kornilov
Hello > I think I like "unpaused" better here, because "resumed" would seem to > imply that recovery can actually continue. Good, I agree. > One thing that has not been added to my patch is the equivalent of > 496ee647ecd2917369ffcf1eaa0b2cdca07c8730, which allows promotion while > recovery is p

Re: Stronger safeguard for archive recovery not to miss data

2020-11-25 Thread Sergei Kornilov
Hello > First of all, I confirmed the server started up without this patch. It is possible only with manually configured hot_standby = off, right? We have ERROR in hot standby mode just below in CheckRequiredParameterValues. regards, Sergei

Re: Improve handling of parameter differences in physical replication

2021-01-15 Thread Sergei Kornilov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed Hello Look good for me. I think the patch is ready for commiter.

hint Consider using pg_file_read()

2021-03-18 Thread Sergei Kornilov
Hello In src/backend/utils/adt/genfile.c in pg_read_file we have errhint > errhint("Consider using %s, which is part of core, instead.", >"pg_file_read()") Shouldn't pg_read_file() be written here? regards, Sergei

Re: hint Consider using pg_file_read()

2021-03-18 Thread Sergei Kornilov
I noticed that the fix has been committed, thank you! regards, Sergei

Re: Confused with PostgreSQL on Synology NAS

2021-11-10 Thread Sergei Kornilov
Hello postgresql uses hba_file configuration parameter: https://www.postgresql.org/docs/current/runtime-config-file-locations.htmlSo could be changed in postgresql.conf regards, Sergei

unexpected plan with id = any('{}') condition

2021-11-11 Thread Sergei Kornilov
Hello I have such case: create table test (id int not null, status text);insert into test select i, 'foo' from generate_series(1,100) i;update test set status = 'bar' where id <= 10;create index test_id on test (id );create index test_status_partial on test (status) where status = 'bar';analyze

Re:unexpected plan with id = any('{}') condition

2021-11-11 Thread Sergei Kornilov
Hello Thank you for the explanation! > unreadable HTML mess ouch, sorry. "Nobody uses plain text mail, we dropped this thing in the interface” said yandex team. (I know that some members of the Yandex team read mailing lists, could you ping your colleagues?) > but I'm not convinced we want to

Re: Commit fest 2017-11

2018-03-29 Thread Sergei Kornilov
Hello I can not find "Reports" in bottom any page of CF app... Such stats covers only reviews marked in CF app? Through "Comment"->"Review" buttons? I'm afraid this statistics will be inaccurate for new users (like me). Wiki page https://wiki.postgresql.org/wiki/Reviewing_a_Patch say > Send revi

Re: using index or check in ALTER TABLE SET NOT NULL

2018-04-06 Thread Sergei Kornilov
1/29/17 10:52, Sergei Kornilov wrote: >>  My target problem of adding NOT NULL to big relation without long downtime >> can be done with ADD CONSTRAINT NOT VALID, VALIDATE it in second >> transaction, then SET NOT NULL by my patch and drop unneeded constraint. > > It seems to

Re: using index or check in ALTER TABLE SET NOT NULL

2018-04-09 Thread Sergei Kornilov
Hello I notice my patch does not apply again. Here is update to current HEAD regards, Sergeidiff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index bd22627..db98a98 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -215,8 +21

Re: Custom PGC_POSTMASTER GUC variables ... feasible?

2018-04-10 Thread Sergei Kornilov
Hello See for example contrib pg_stat_statements extension. Setting pg_stat_statements.max defined as PGC_POSTMASTER regards, Sergei

Re: using index or check in ALTER TABLE SET NOT NULL

2018-04-11 Thread Sergei Kornilov
Hi I noticed new merge conflict, updated version attached. regards, Sergeidiff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index bd22627..db98a98 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -215,8 +215,15 @@ WITH ( MOD

Re: using index or check in ALTER TABLE SET NOT NULL

2018-04-15 Thread Sergei Kornilov
Hello Attached updated patch follows recent Reorganize partitioning code commit. regards, Sergeidiff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index bd22627..db98a98 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -215,8

Re: Reopen logfile on SIGHUP

2018-04-25 Thread Sergei Kornilov
Hello Something was wrong? Attached file is empty. regards, Sergei

Re: pg_get_databasebyid(oid)

2019-09-04 Thread Sergei Kornilov
Hello Thank you for attention! I marked CF entry as returned with feedback. regards, Sergei

Re: Planning counters in pg_stat_statements (using pgss_store)

2019-09-04 Thread Sergei Kornilov
Hello I think the most important question for this topic is performance penalty. It was a long story, first test on my desktop was too volatile. I setup separate PC with DB only and test few cases. PC spec: 2-core Intel Core 2 Duo E6550, 4GB ram, mechanical HDD All tests on top 7dedfd22b79822b7f

Re: Change ereport level for QueuePartitionConstraintValidation

2019-09-08 Thread Sergei Kornilov
Hello > Hearing no comments, I've pushed that patch, and marked the v12 > open item closed. Thank you! regards, Sergei

Re: allow online change primary_conninfo

2019-09-19 Thread Sergei Kornilov
Hello Thank you for review! > ISTM that you need to update the above parts in postgresql.conf.sample. Good catch, I forgot about conf sample. > ISTM that you need to update the above comment in walreceiver.c. Changed > If primary_conninfo is set to an empty string, walreceiver just shuts down

Re: allow online change primary_conninfo

2019-09-19 Thread Sergei Kornilov
Hello Thank you for review! > - This parameter can only be set at server start. > + This parameter can only be set in the postgresql.conf > + file or on the server command line. > > I'm not sure it's good to change the context of this > description. This was mentioning that changing of this param

Re: allow online change primary_conninfo

2019-09-21 Thread Sergei Kornilov
Hello Thank you for review! Can you please also check v4 version? v5 implements design suggested by Kyotaro Horiguchi-san, while v4 has another design. Which one do you prefer? Or are both wrong? > I can't parse that comment. What does "skipping to starting" mean? I > assume it's just about avo

Re: bgwriter_lru_maxpages limits in PG 10 sample conf

2019-02-27 Thread Sergei Kornilov
Hello postgresql.conf.sample was changed recently in REL_10_STABLE (commit ab1d9f066aee4f9b81abde6136771debe0191ae8) So config will be changed in next minor release anyway. We have another reason to not fix bgwriter_lru_maxpages comment? regards, Sergei

Re: reloption to prevent VACUUM from truncating empty pages at the end of relation

2019-02-27 Thread Sergei Kornilov
Hi > The default should always be to shrink, unless either the VACUUM > option or the reloption turn that off. (So it doesn't make sense to set > either the VACUUM option or the reloption to "on"). I think VACUUM option can be set to "on" by hand in order to override reloption only for this VACU

Re: Prevent extension creation in temporary schemas

2019-02-28 Thread Sergei Kornilov
Hi > I found that this strange error appears after making > temporary tables. > > test=> CREATE TEMPORARY TABLE temp (id int); > CREATE TABLE > test=> CREATE EXTENSION file_fdw WITH SCHEMA pg_temp_3; > ERROR: function file_fdw_handler() does not exist > > I would try to understand this problem for

Re: Question about pg_upgrade from 9.2 to X.X

2019-02-28 Thread Sergei Kornilov
Hello pgsql-hackers seems wrong list for such question. > could not load library "$libdir/hstore": ERROR:  could not access file > "$libdir/hstore": No such file or directory > could not load library "$libdir/adminpack": ERROR:  could not access file > "$libdir/adminpack": No such file or direc

Re: Question about pg_upgrade from 9.2 to X.X

2019-02-28 Thread Sergei Kornilov
Hi > Yes, i want to get rid of old extension, Could you please share the query to > find extension which is using pg_reorg. pg_reorg is name for both tool and extension. Check every database in cluster with, for example, psql command "\dx" or read pg_dumpall -s output for some CREATE EXTENSION

Re: allow online change primary_conninfo

2019-03-02 Thread Sergei Kornilov
Hello This might be not the right way, but I can't think of a better way to not switch to a different method than split of lastSourceFailed processing and starting new source. Something like refactoring in first attached patch. I move RequestXLogStreaming logic from lastSourceFailed processing

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-05 Thread Sergei Kornilov
Hello, David! > I've made a pass over v10. I think it's in pretty good shape, but I > did end up changing a few small things. Thank you! I merged your changes to new patch version. > The only thing that I'm a bit unsure of is the tests. I've read the > thread and I see the discussion above about

Re: pg_basebackup against older server versions

2019-03-06 Thread Sergei Kornilov
Hello My fault. I thought pg_basebackup works only with same major version, sorry. How about attached patch? regards, Sergeidiff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 3d2d4cd0b9..e1aa2c1cfc 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c ++

Re: pg_basebackup against older server versions

2019-03-06 Thread Sergei Kornilov
Hi > No problem. Thanks for the patch, the logic looks good and I made > some adjustments as attached. Does that look fine to you? Looks fine, thanks. I tested against HEAD and v11.2 with and without -R in both plain and tar formats. regards, Sergei

Re: pg_basebackup against older server versions

2019-03-08 Thread Sergei Kornilov
HiGreat, thank you! regards, Sergei

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-10 Thread Sergei Kornilov
Hi > Providing I'm imagining it correctly, I do think the patch is slightly > cleaner with that change. Ok, sounds reasonable. I changed patch this way. regards, Sergeidiff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 890b23afd6..926b3361ea 100644 --- a/doc

Re: Offline enabling/disabling of data checksums

2019-03-11 Thread Sergei Kornilov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:tested, passed Hello I review latest patchset. I have one big question: Is pg_c

Re: Offline enabling/disabling of data checksums

2019-03-12 Thread Sergei Kornilov
Hi > Not doing the check is a bad idea as ControlFileData should be compatible > between the binary and the data read. I am attaching a fresh 0001 > which should be back-patched down to v11 as a bug fix. Looks fine. We need add few words to documentation? >>>  if (badblocks > 0) >>> retu

Re: Offline enabling/disabling of data checksums

2019-03-12 Thread Sergei Kornilov
Hello Thank you for explain. I thought so. PS: I am not sure for now about patch status in CF app. Did not changed status regards, Sergei

Re: pg_stat_statements vs. SELECT FOR UPDATE

2019-03-12 Thread Sergei Kornilov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, passed Spec compliant: not tested Documentation:not tested Hello Patch is applied cleanly, compiles and pass check-world. Has t

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-12 Thread Sergei Kornilov
Hello > Dispatches from the department of grammatical nitpicking... Thank you! > + entire table, however if a valid CHECK constraint is > > I think this should be: > > entire table; however, if... > > + * are set NOT NULL, however, if we can find a constraint which proves > > similarly here Cha

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Sergei Kornilov
Hi One new question from me: how about replication? Case: primary+replica, we shut down primary and enable checksum, and "started streaming WAL from primary" without any issue. I have master with checksums, but replica without. Or cluster with checksums, then disable checksums on primary, but st

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Sergei Kornilov
Hi >> One new question from me: how about replication? >> Case: primary+replica, we shut down primary and enable checksum, and >> "started streaming WAL from primary" without any issue. I have master with >> checksums, but replica without. >> Or cluster with checksums, then disable checksums on

Re: Offline enabling/disabling of data checksums

2019-03-13 Thread Sergei Kornilov
Hi, >>  > Also we support ./configure --with-blocksize=(not equals 8)? make >>  > check on HEAD fails for me. If we support this - i think we need >>  > recheck BLCKSZ between compiled pg_checksum and used in PGDATA >> >>  You mean if the backend and pg_checksums is built with different >>  blocks

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Sergei Kornilov
Wow, thank you! 13.03.2019, 15:57, "Robert Haas" : > On Tue, Mar 12, 2019 at 4:27 PM Sergei Kornilov wrote: >>  Agreed, in attached new version ... > > Committed with a little more nitpicking. > > -- > Robert Haas > EnterpriseDB: http://www.enterprisedb.com > The Enterprise PostgreSQL Company

Re: REINDEX CONCURRENTLY 2.0

2019-03-13 Thread Sergei Kornilov
Hello Patch is marked as target version 12, but is inactive few weeks long. I think many users want this feature and patch is in good shape. We have open questions on this thread? Latest patch still can be aplied cleanly; it builds and pass tests. regards, Sergei

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Sergei Kornilov
Hi > The buildfarm thinks additional nitpicking is needed. hm. Patch was committed with debug1 level tests and many animals uses log_statement = 'all'. Therefore they have additional line in result: LOG: statement: alter table pg_class alter column relname drop not null; and similar for other

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-13 Thread Sergei Kornilov
Hi > Ugh, I guess so. Or how about changing the message itself to use > INFO, like we already do in QueuePartitionConstraintValidation? Fine for me. But year ago this was implemented in my patch and Tom voted against using INFO level for such purpose: https://www.postgresql.org/message-id/1142.

Change ereport level for QueuePartitionConstraintValidation

2019-03-15 Thread Sergei Kornilov
Hello Per discussion started here: https://www.postgresql.org/message-id/CA%2BTgmoZWSLUjVcc9KBSVvbn%3DU5QRgW1O-MgUX0y5CnLZOA2qyQ%40mail.gmail.com We have INFO ereport messages in alter table attach partition like this: > partition constraint for table \"%s\" is implied by existing constraints P

Re: using index or check in ALTER TABLE SET NOT NULL

2019-03-17 Thread Sergei Kornilov
Hello > If we don't have this for SET NOT NULL then we should either add it or > remove the one from ATTACH PARTITION. I proposed to lower report level to debug1 in a separate thread: https://www.postgresql.org/message-id/4859321552643736%40myt5-02b80404fd9e.qloud-c.yandex.net Possible better wo

Re: [HACKERS] Block level parallel vacuum

2019-03-21 Thread Sergei Kornilov
Hello > * in_parallel is true if we're performing parallel lazy vacuum. Since any > * updates are not allowed during parallel mode we don't update statistics > * but set the index bulk-deletion result to *stats. Otherwise we update it > * and set NULL. lazy_cleanup_index has in_parallel argument

Re: REINDEX CONCURRENTLY 2.0

2019-03-23 Thread Sergei Kornilov
Hello Yet another review of this patch from me... >An index build with the CONCURRENTLY option failed, > leaving >an invalid index. Such indexes are useless but it can be > - convenient to use REINDEX to rebuild them. Note that > - REINDEX will not perform a concurrent

Re: ALTER TABLE with ADD COLUMN and ADD PRIMARY KEY USING INDEX throws spurious "column contains null values"

2019-03-25 Thread Sergei Kornilov
Hi I did not review patch, just want add link to related bug 15580 and one another -hackers thread: https://www.postgresql.org/message-id/flat/15580-d1a6de5a3d65da51%40postgresql.org https://www.postgresql.org/message-id/flat/CAOVr7%2B3C9u_ZApjxpccrorvt0aw%3Dk8Ct5FhHRVZA-YO36V3%3Drg%40mail.gmail

Re: Planning counters in pg_stat_statements (using pgss_store)

2019-03-28 Thread Sergei Kornilov
Hi >>  Ok, but keep in mind that this is the last commitfest for pg12, and >>  there are only 4 days left. Will you have time to take care of it, or >>  do you need help on it? > > Oups, sorry, I won't have time nor knowledge to finish in time ;o( > Any help is welcome ! No need to rush, this pat

Re: REINDEX CONCURRENTLY 2.0

2019-03-28 Thread Sergei Kornilov
Hi Unfortunately patch does not apply due recent commits. Any chance this can be fixed (and even committed in pg12)? >>  And few questions: >>  - reindexdb has concurrently flag logic even in reindex_system_catalogs, >> but "reindex concurrently" can not reindex system catalog. Is this expected

Re: REINDEX CONCURRENTLY 2.0

2019-03-29 Thread Sergei Kornilov
>>  Unfortunately patch does not apply due recent commits. Any chance this can >> be fixed (and even committed in pg12)? > > Committed :) wow! Congratulations! This was very long way my favorite pg12 feature regards, Sergei

Re: Add parallelism and glibc dependent only options to reindexdb

2019-07-25 Thread Sergei Kornilov
The following review has been posted through the commitfest application: make installcheck-world: tested, passed Implements feature: tested, failed Spec compliant: not tested Documentation:tested, passed Hi I did some review and have few notes about behavior. reindex

Re: Add parallelism and glibc dependent only options to reindexdb

2019-07-25 Thread Sergei Kornilov
Hi Thank you, v9 code and behavior looks good for me. Builds cleanly, works with older releases. I'll mark Ready to Commiter. > I don't have a strong opinion here. If we change for >=, it'd be > better to also adapt vacuumdb for consistency. I didn't change it for > now, to stay consistent with

Re: Add parallelism and glibc dependent only options to reindexdb

2019-07-25 Thread Sergei Kornilov
Hi >>>  I don't have a strong opinion here. If we change for >=, it'd be >>>  better to also adapt vacuumdb for consistency. I didn't change it for >>>  now, to stay consistent with vacuumdb. >> >>  Yep, no strong opinion from me too. > > My opinion tends towards consistency. Consistency sounds go

Re: Add parallelism and glibc dependent only options to reindexdb

2019-07-26 Thread Sergei Kornilov
Hi > So here we go: > - 0001 is your original thing, with --jobs enforced to 1 for the index > part. > - 0002 is my addition to forbid --index with --jobs. > > I am fine to be outvoted regarding 0002, and it is the case based on > the state of this thread with 2:1. We could always revisit this > d

Re: allow online change primary_conninfo

2019-08-01 Thread Sergei Kornilov
Hello > It has been some time, and I am finally catching up with this patch. Thank you! > + > + WAL receiver will be restarted after primary_slot_name > + was changed. >    > The sentence sounds strange. Here is a suggestion: > The WAL receiver is restarted after an update of primary_sl

Re: complier warnings from ecpg tests

2019-08-02 Thread Sergei Kornilov
Hi >>  Thanks for the set of flags. So this comes from the use of -Og, and >>  the rest of the tree does not complain. The issue is that gcc >>  complains about the buffer not being large enough, but %d only uses up >>  to 2 characters so there is no overflow. In order to fix the issue it >>  is f

Re: Change ereport level for QueuePartitionConstraintValidation

2019-08-15 Thread Sergei Kornilov
Hi > Sergei, can we enlist you to submit a patch for this? Namely reduce the > log level to DEBUG1 and add a TAP test in src/test/modules/alter_table/ > that verifies that the message is or isn't emitted, as appropriate. Yes, will do. Probably in few days. regards, Sergei

Re: max_parallel_workers can't actually be set?

2019-08-17 Thread Sergei Kornilov
Hello > Try this: > alter system set max_parallel_workers = 20; > and restart the system. > max_parallel_workers is still 8 Hmm, I got 20 on my local 11.5 and on HEAD. > which should certainly not happen for a PGC_POSTMASTER parameter. But max_parallel_workers is PGC_USERSET and this behavior s

psql \r command is working?

2019-08-19 Thread Sergei Kornilov
Hello Is psql command \r actually works? I expected \r and then \e command should start editor without text of last query. LANG=C EDITOR=cat psql psql (11.5 (Debian 11.5-1.pgdg100+1)) Type "help" for help. melkij=> select 1; ?column? -- 1 (1 row) melkij=> \r Query buffer res

Re: psql \r command is working?

2019-08-19 Thread Sergei Kornilov
so this is expected behavior, ok, thank you! regards, Sergei

Re: Change ereport level for QueuePartitionConstraintValidation

2019-08-20 Thread Sergei Kornilov
Hello > Sergei, can we enlist you to submit a patch for this? Namely reduce the > log level to DEBUG1 and add a TAP test in src/test/modules/alter_table/ > that verifies that the message is or isn't emitted, as appropriate. I created this patch. I test message existence. Also I check message "ver

Re: Optimization of vacuum for logical replication

2019-08-21 Thread Sergei Kornilov
Hello > Also I can't believe that  DBA which explicitly sets wal_level is set to > logical will use streaming replication without associated replication slot. I am. > Yes, it is possible to have physical replica withotu replication slot. > But it is not safe, because there is always a risk that

Re: Change ereport level for QueuePartitionConstraintValidation

2019-08-21 Thread Sergei Kornilov
Hello I noticed appveyor build on windows is not happy: > perl buildsetup.pl > Could not determine contrib module type for alter_table > at buildsetup.pl line 38. But I have no idea why. I can't check on windows. Possible I miss some change while adding new module to tree. Will check. Please l

Re: Change ereport level for QueuePartitionConstraintValidation

2019-08-25 Thread Sergei Kornilov
Hello Thank you! It seems the most appropriate option for this test is to change @contrib_excludes Done in attached patch, will check appveyor reaction. regards, Sergeidiff --git a/src/test/modules/Makefile b/src/test/modules/Makefile index 60d6d7be1b..ab3fc91fae 100644 --- a/src/test/modules/Ma

Re: allow online change primary_conninfo

2019-08-28 Thread Sergei Kornilov
Hello Updated patch attached. (also I merged into one file) > + > + WAL receiver will be restarted after primary_slot_name > + was changed. >    > The sentence sounds strange. Here is a suggestion: > The WAL receiver is restarted after an update of primary_slot_name (or > primary_conninf

pg_get_databasebyid(oid)

2019-08-28 Thread Sergei Kornilov
Hello We already have function pg_get_userbyid(oid) with lookup in pg_authid catalog. My collegue ask me can we add similar function pg_get_databasebyid(oid) with lookup in pg_databases. It is simple function to get a database name by oid and fallback to 'unknown (OID=n)' if missing. The propos

Re: pg_get_databasebyid(oid)

2019-08-28 Thread Sergei Kornilov
> Please add that to commitfest. Done: https://commitfest.postgresql.org/24/2261/ regards, Sergei

Re: pg_get_databasebyid(oid)

2019-08-29 Thread Sergei Kornilov
Hello > Is there a need for this function for the user? This was feature request from user. I got such comment: This function is useful when working with pg_stat_statements. For obtaining a databаse name for particular query you need to join pg_database relation, but for obtaining an username

Re: [HACKERS] Restricting maximum keep segments by repslots

2018-01-11 Thread Sergei Kornilov
Hello >> patch -p1 gives some "Stripping trailing CRs from patch" >> messages for me, but applied to current HEAD and builds. After > > Hmm. I wonder why I get that complaint so often. (It's rather > common? or caused by the MIME format of my mail?) I'd say with > confidence that it is because y

Re: numeric regression test passes, but why?

2018-01-11 Thread Sergei Kornilov
Hello I am surprised, but i can confirm error on versions prior 9.6: on 9.5, 9.4, 9.3 same error. On 9.6 and 10 query works correctly All checked postgresql are x86_64 from postgresql debian repository: http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main postgres=# select 0.5678::numeric o

Re: Identifying ALTER TABLE "sub-command"

2018-01-11 Thread Sergei Kornilov
HelloYou can start with functions ATPrepCmd and ATExecCmd in src/backend/commands/tablecmds.cAlso note, one alter table statement can have multiple different actions. Regards, Sergei11.01.2018, 18:56, "Jeremy Finzel" :Hello -I have found that in leveraging the parser code to decode DDL SQL, it is v

Re: using index or check in ALTER TABLE SET NOT NULL

2018-01-23 Thread Sergei Kornilov
Hello Stephen I changed the suggested things and added some regression tests. Also i wrote few words to the documentation. New patch is attached. Thank you for feedback! regards, Sergeidiff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 286c7a8..cf2c56f 10064

Re: Index-only scan returns incorrect results when using a composite GIST index with a gist_trgm_ops column.

2018-01-23 Thread Sergei Kornilov
Hello I tested this patch and think it can be commited to master. Is there a CF record? I can not find one. Should we also make backport to older versions? I test on REL_10_STABLE - patch builds and works ok, but "make check" fails on new testcase with error: > CREATE INDEX ON t USING gist (a t

Re: Using scalar function as set-returning: bug or feature?

2018-02-08 Thread Sergei Kornilov
Hello > select into b from my_insert('from func atx'); You missed select something into b. For example, select ret into b from my_insert('from func atx') as ret; Using scalar function in from is not bug. Silent assigning NULL for variables in "into" not matches same in "select"... I think better

Re: Is this a bug?

2018-02-14 Thread Sergei Kornilov
Hello No, this is not bug. https://www.postgresql.org/docs/10/static/hot-standby.html#HOT-STANDBY-CONFLICT Message in DETAIL describe conflict reason. > Application of a vacuum cleanup record from WAL conflicts with queries > accessing the target page on the standby, whether or not the data to b

Re: allow online change primary_conninfo

2019-10-31 Thread Sergei Kornilov
Hello > So, I'd like to propose to move the stuff to the second switch(). > (See the attached incomplete patch.) This is rather similar to > Sergei's previous proposal, but the structure of the state > machine is kept. Very similar to my v4 proposal (also move RequestXLogStreaming call), but clo

Re: base backup client as auxiliary backend process

2019-11-15 Thread Sergei Kornilov
Hello Could you rebase patch please? I have errors during patch apply. CFbot checks latest demonstration patch. > I looked into this. It seems trivial to make walsender create and use a > temporary replication slot by default if no permanent replication slot > is specified. This is basically the

Re: could not stat promote trigger file leads to shutdown

2019-11-15 Thread Sergei Kornilov
Hello > Maybe we need a new elevel category for that. > SYSTEM_WARNING or LOG_WARNING, perhaps? I think a separate levels for user warnings and system warnings (and errors) would be great for log analytics. Error due to user typo in query is not the same as cache lookup error (for example). re

Re: [HACKERS] Block level parallel vacuum

2019-11-30 Thread Sergei Kornilov
Hello Its possible to change order of index processing by parallel leader? In v35 patchset I see following order: - start parallel processes - leader and parallel workers processed index lixt and possible skip some entries - after that parallel leader recheck index list and process the skipped i

Re: [HACKERS] Block level parallel vacuum

2019-12-01 Thread Sergei Kornilov
Hi > I think the advantage of the current approach is that once the parallel > workers are launched, the leader can process indexes that don't support > parallelism.  So, both type of indexes can be processed at the same time. In lazy_parallel_vacuum_or_cleanup_indexes I see: /*

Re: [HACKERS] Block level parallel vacuum

2019-12-01 Thread Sergei Kornilov
Hi > I think I got your point. Your proposal is that it's more efficient if > we make the leader process vacuum the index that can be processed only > the leader process (i.e. indexes not supporting parallel index vacuum) > while workers are processing indexes supporting parallel index vacuum, > r

Re: Sketch of a fix for that truncation data corruption issue

2019-12-05 Thread Sergei Kornilov
Hello >>  > Also, I'm not entirely sure whether there's anything in our various >>  > replication logic that's dependent on vacuum truncation taking AEL. >>  > Offhand I'd expect the reduced use of AEL to be a plus, but maybe >>  > I'm missing something. >> >>  It'd be a *MAJOR* plus. One of the b

Re: global / super barriers (for checksums)

2019-12-17 Thread Sergei Kornilov
Hello > Stellar. If nobody objects in the meantime, I plan to commit 0001-0003 > next week. My compiler (gcc 8.3.0) is not happy with recent 5910d6c7e311f0b14e3d3cb9ce3597c01d3a3cde commit: autovacuum.c:831:1: error: ‘AutoVacLauncherShutdown’ was used with no prototype before its definition [-

  1   2   3   4   >