Permute underscore separated components of columns before fuzzy matching
Hello,
we have the great fuzzy string match, that comes up with suggestions in the case of a typo of a column name.
Since underscores are the de facto standard of separating words, it would also make sense to also generate suggestions, if the order of words gets mixed up. Example: If the user types timstamp_entry instead of entry_timestamp the suggestion shows up.
The attached patch does that for up to three segments, that are separated by underscores. The permutation of two segments is treated the same way a wrongly typed char would be.
The permutation is skipped, if the typed column name contains more than 6 underscores to prevent a meaningful (measured on my development machine) slowdown, if the user types to many underscores. In terms of underscores m and the length of the individual strings n_att and n_col the trivial upper bound is O(n_att * n_col * m^2). Considering, that strings with a lot of underscores have a bigger likelihood of being long as well, I simply decided to add it. I still wonder a bit whether it should be disabled entirely (as this patch does) or only the swap-three sections part as the rest would bound by O(n_att * n_col * m). But the utility of only swapping two sections seems a bit dubious to me, if I have 7 or more of them.
To me this patch seems simple (if string handling in C can be called that way) and self contained. Despite my calculations above, it resides in a non performance critical piece of code. I think of it as a quality of life thing.
Let me know what you think. Thank you!
Regards
Arne
Attachments:
0001-fuzzy_underscore_permutation.patchtext/x-patch; name=0001-fuzzy_underscore_permutation.patchDownload+80-24
Hello Arne,
The goal of supporting words-switching hints sounds interesting and I've
tried to apply your patch.
The patch was applied smoothly to the latest master and check-world
reported no problems. Although I had problems after trying to test the new
functionality.
I tried to simply mix words in pg_stat_activity.wait_event_type:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] ERROR: column "wait_type_event" does
not exist at character 8
2023-07-06 14:12:35.968 MSK [1480] HINT: Perhaps you meant to reference
the column "pg_stat_activity.wait_event_type".
2023-07-06 14:12:35.968 MSK [1480] STATEMENT: select wait_type_event from
pg_stat_activity ;
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
^
HINT: Perhaps you meant to reference the column
"pg_stat_activity.wait_event_type".
postgres=#
So the desired hint is really there, but thgether with looots of warnings.
For sure these should not be be encountered.
And no, this is not some kind of side problem brought by some other commit.
The same request on a plain master branch performs without these warnings:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:10:17.171 MSK [22431] ERROR: column "wait_type_event" does
not exist at character 8
2023-07-06 14:10:17.171 MSK [22431] STATEMENT: select wait_type_event from
pg_stat_activity ;
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
--
best regards,
Mikhail A. Gribkov
e-mail: youzhick@gmail.com
*http://www.flickr.com/photos/youzhick/albums
<http://www.flickr.com/photos/youzhick/albums>*
http://www.strava.com/athletes/5085772
phone: +7(916)604-71-12
Telegram: @youzhick
The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, failed
Documentation: tested, failed
Hello Arne,
The goal of supporting words-switching hints sounds interesting and I've tried to apply your patch.
The patch was applied smoothly to the latest master and check-world reported no problems. Although I had problems after trying to test the new functionality.
I tried to simply mix words in pg_stat_activity.wait_event_type:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] ERROR: column "wait_type_event" does not exist at character 8
2023-07-06 14:12:35.968 MSK [1480] HINT: Perhaps you meant to reference the column "pg_stat_activity.wait_event_type".
2023-07-06 14:12:35.968 MSK [1480] STATEMENT: select wait_type_event from pg_stat_activity ;
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
^
HINT: Perhaps you meant to reference the column "pg_stat_activity.wait_event_type".
postgres=#
So the desired hint is really there, but thgether with looots of warnings. For sure these should not be be encountered.
And no, this is not some kind of side problem brought by some other commit. The same request on a plain master branch performs without these warnings:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:10:17.171 MSK [22431] ERROR: column "wait_type_event" does not exist at character 8
2023-07-06 14:10:17.171 MSK [22431] STATEMENT: select wait_type_event from pg_stat_activity ;
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
The new status of this patch is: Waiting on Author
Hello Mikhail,
I'm sorry. Please try attached patch instead.
Thank you for having a look!
Regards
Arne
________________________________
From: Mikhail Gribkov <youzhick@gmail.com>
Sent: Thursday, July 6, 2023 13:31
To: Arne Roland <A.Roland@index.de>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Permute underscore separated components of columns before fuzzy matching
Hello Arne,
The goal of supporting words-switching hints sounds interesting and I've tried to apply your patch.
The patch was applied smoothly to the latest master and check-world reported no problems. Although I had problems after trying to test the new functionality.
I tried to simply mix words in pg_stat_activity.wait_event_type:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] ERROR: column "wait_type_event" does not exist at character 8
2023-07-06 14:12:35.968 MSK [1480] HINT: Perhaps you meant to reference the column "pg_stat_activity.wait_event_type".
2023-07-06 14:12:35.968 MSK [1480] STATEMENT: select wait_type_event from pg_stat_activity ;
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
^
HINT: Perhaps you meant to reference the column "pg_stat_activity.wait_event_type".
postgres=#
So the desired hint is really there, but thgether with looots of warnings. For sure these should not be be encountered.
And no, this is not some kind of side problem brought by some other commit. The same request on a plain master branch performs without these warnings:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:10:17.171 MSK [22431] ERROR: column "wait_type_event" does not exist at character 8
2023-07-06 14:10:17.171 MSK [22431] STATEMENT: select wait_type_event from pg_stat_activity ;
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
--
best regards,
Mikhail A. Gribkov
e-mail: youzhick@gmail.com<mailto:youzhick@gmail.com>
http://www.flickr.com/photos/youzhick/albums
http://www.strava.com/athletes/5085772
phone: +7(916)604-71-12
Telegram: @youzhick
Attachments:
0001-fuzzy_underscore_permutation.patchtext/x-patch; name=0001-fuzzy_underscore_permutation.patchDownload+80-24
Hello Arne,
yep, now the warnings have gone. And I must thank you for quite a fun time
I had here testing your patch :) I tried even some weird combinations like
this:
postgres=# create table t("_ __ ___" int);
CREATE TABLE
postgres=# select "__ _ ___" from t;
ERROR: column "__ _ ___" does not exist
LINE 1: select "__ _ ___" from t;
^
HINT: Perhaps you meant to reference the column "t._ __ ___".
postgres=# select "___ __ _" from t;
ERROR: column "___ __ _" does not exist
LINE 1: select "___ __ _" from t;
^
HINT: Perhaps you meant to reference the column "t._ __ ___".
postgres=#
... and it still worked fine.
Honestly I'm not entirely sure fixing only two switched words is worth the
effort, but the declared goal is clearly achieved.
I think the patch is good to go, although you need to fix code formatting.
At least the char*-definition and opening "{" brackets are conspicuous.
Maybe there are more: it is worth running pgindend tool.
And it would be much more convenient to work with your patch if every next
version file will have a unique name (maybe something like "_v2", "_v3"
etc. suffixes)
--
best regards,
Mikhail A. Gribkov
e-mail: youzhick@gmail.com
*http://www.flickr.com/photos/youzhick/albums
<http://www.flickr.com/photos/youzhick/albums>*
http://www.strava.com/athletes/5085772
phone: +7(916)604-71-12
Telegram: @youzhick
On Mon, Jul 17, 2023 at 1:42 AM Arne Roland <A.Roland@index.de> wrote:
Show quoted text
Hello Mikhail,
I'm sorry. Please try attached patch instead.
Thank you for having a look!
Regards
Arne------------------------------
*From:* Mikhail Gribkov <youzhick@gmail.com>
*Sent:* Thursday, July 6, 2023 13:31
*To:* Arne Roland <A.Roland@index.de>
*Cc:* Pg Hackers <pgsql-hackers@lists.postgresql.org>
*Subject:* Re: Permute underscore separated components of columns before
fuzzy matchingHello Arne,
The goal of supporting words-switching hints sounds interesting and I've
tried to apply your patch.
The patch was applied smoothly to the latest master and check-world
reported no problems. Although I had problems after trying to test the new
functionality.I tried to simply mix words in pg_stat_activity.wait_event_type:
postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] WARNING: detected write past chunk end
in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
2023-07-06 14:12:35.968 MSK [1480] ERROR: column "wait_type_event" does
not exist at character 8
2023-07-06 14:12:35.968 MSK [1480] HINT: Perhaps you meant to reference
the column "pg_stat_activity.wait_event_type".
2023-07-06 14:12:35.968 MSK [1480] STATEMENT: select wait_type_event from
pg_stat_activity ;
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
WARNING: detected write past chunk end in MessageContext 0x559d668aaf30
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
^
HINT: Perhaps you meant to reference the column
"pg_stat_activity.wait_event_type".
postgres=#So the desired hint is really there, but thgether with looots of warnings.
For sure these should not be be encountered.And no, this is not some kind of side problem brought by some other
commit. The same request on a plain master branch performs without these
warnings:postgres=# select wait_type_event from pg_stat_activity ;
2023-07-06 14:10:17.171 MSK [22431] ERROR: column "wait_type_event" does
not exist at character 8
2023-07-06 14:10:17.171 MSK [22431] STATEMENT: select wait_type_event
from pg_stat_activity ;
ERROR: column "wait_type_event" does not exist
LINE 1: select wait_type_event from pg_stat_activity ;
--
best regards,
Mikhail A. Gribkove-mail: youzhick@gmail.com
*http://www.flickr.com/photos/youzhick/albums
<http://www.flickr.com/photos/youzhick/albums>*
http://www.strava.com/athletes/5085772
phone: +7(916)604-71-12
Telegram: @youzhick
Mikhail Gribkov <youzhick@gmail.com> writes:
Honestly I'm not entirely sure fixing only two switched words is worth the
effort, but the declared goal is clearly achieved.
I think the patch is good to go, although you need to fix code formatting.
I took a brief look at this. I concur that we shouldn't need to be
hugely concerned about the speed of this code path. However, we *do*
need to be concerned about its maintainability, and I think the patch
falls down badly there: it adds a chunk of very opaque and essentially
undocumented code, that people will need to reverse-engineer anytime
they are studying this function. That could be alleviated perhaps
with more work on comments, but I have to wonder whether it's worth
carrying this logic at all. It's a rather strange behavior to add,
and I wonder if many users will want it.
One thing that struck me is that no care is being taken for adjacent
underscores (that is, "foo__bar" and similar cases). It seems
unlikely that treating the zero-length substring between the
underscores as a word to permute is helpful; moreover, it adds
an edge case that the string-moving logic could easily get wrong.
I wonder if the code should treat any number of consecutive
underscores as a single separator. (Somewhat related: I think it
will behave oddly when the first or last character is '_', since the
outer loop ignores those positions.)
And it would be much more convenient to work with your patch if every next
version file will have a unique name (maybe something like "_v2", "_v3"
etc. suffixes)
Please. It's very confusing when there are multiple identically-named
patches in a thread.
regards, tom lane