pgsql: Remove unneeded null pointer checks before PQfreemem()

2022-08-26 Thread Peter Eisentraut
Remove unneeded null pointer checks before PQfreemem() PQfreemem() just calls free(), and the latter already checks for null pointers. Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/cf26e970-8e92-59f1-247a-aa265235075b%40enterprisedb.com Branch -- master

pgsql: Remove unnecessary casts in free() and pfree()

2022-08-26 Thread Peter Eisentraut
Remove unnecessary casts in free() and pfree() Reviewed-by: Tom Lane Discussion: https://www.postgresql.org/message-id/flat/cf26e970-8e92-59f1-247a-aa265235075b%40enterprisedb.com Branch -- master Details ---

Re: pgsql: Use SSE2 in is_valid_ascii() where available.

2022-08-26 Thread John Naylor
On Fri, Aug 26, 2022 at 3:59 PM John Naylor wrote: > Per flame graph from Jelte Fennema, COPY FROM ... USING BINARY shows For the archives: This is not correct syntax: should be COPY BINARY or ... WITH BINARY. -- John Naylor EDB: http://www.enterprisedb.com

pgsql: Use SSE2 in is_valid_ascii() where available.

2022-08-26 Thread John Naylor
Use SSE2 in is_valid_ascii() where available. Per flame graph from Jelte Fennema, COPY FROM ... USING BINARY shows input validation taking at least 5% of the profile, so it's worth trying to be more efficient here. With this change, validation of pure ASCII is nearly 40% faster on contemporary

pgsql: Remove obsolete comment

2022-08-26 Thread Peter Eisentraut
Remove obsolete comment The comment in basebackup.c updated by 33bd4698c11 was actually obsolete to begin with, since the symbols it was referring to haven't existed in that header file for quite some time. The header file is still needed for other reasons, though, so keep the #include, just

pgsql: Remove obsolete comment

2022-08-26 Thread Peter Eisentraut
Remove obsolete comment The comment in basebackup.c updated by 33bd4698c11 was actually obsolete to begin with, since the symbols it was referring to haven't existed in that header file for quite some time. The header file is still needed for other reasons, though, so keep the #include, just

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- master Details --- https://git.postgresql.org/pg/commitdiff/a8b02587a3c20997f8991878eb02ef475a343e1f Modified Files -- src/backend/commands/copyfromparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- REL_14_STABLE Details --- https://git.postgresql.org/pg/commitdiff/28d351c9ff2afe5cc18ef64779c02c49c76896fb Modified Files -- src/backend/commands/copyfromparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- REL_15_STABLE Details --- https://git.postgresql.org/pg/commitdiff/2829cfaf78b6b9d1909ce1dbbdb2839be9697853 Modified Files -- src/backend/commands/copyfromparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- REL_13_STABLE Details --- https://git.postgresql.org/pg/commitdiff/7d501657550619a6a826ab3cf282c3e7bf862bd0 Modified Files -- src/backend/commands/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- REL_12_STABLE Details --- https://git.postgresql.org/pg/commitdiff/4e330af04be0d5fd905a1b5320adbea7fb91b117 Modified Files -- src/backend/commands/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- REL_10_STABLE Details --- https://git.postgresql.org/pg/commitdiff/3a376b90ede113708d2b7cdf48f6fb8d06092c85 Modified Files -- src/backend/commands/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Fix typo in comment.

2022-08-26 Thread Etsuro Fujita
Fix typo in comment. Branch -- REL_11_STABLE Details --- https://git.postgresql.org/pg/commitdiff/1d40200a98557fb36cb620f604b00116ccf4d64a Modified Files -- src/backend/commands/copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

pgsql: Add optimized functions for linear search within byte arrays

2022-08-26 Thread John Naylor
Add optimized functions for linear search within byte arrays In similar vein to b6ef167564, add pg_lfind8() and pg_lfind8_le() to search for bytes equal or less-than-or-equal to a given byte, respectively. To abstract away platform details, add helper functions and typedefs to simd.h. John