]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix oversight in commit aa1f93a33. master github/master
authorEtsuro Fujita <efujita@postgresql.org>
Sun, 14 Jun 2026 07:00:00 +0000 (16:00 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Sun, 14 Jun 2026 07:00:00 +0000 (16:00 +0900)
Since the remote column names of a foreign table could be longer than
NAMEDATALEN, remattrmap_cmp(), which compares such column names, should
have used strcmp(), not strncmp() with n=NAMEDATALEN.

Author: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Etsuro Fujita <etsuro.fujita@gmail.com>
Discussion: https://postgr.es/m/81D981EB-ECC1-495D-8EAC-5CFB67B2CF77%40gmail.com

contrib/postgres_fdw/postgres_fdw.c

index 0a589f8db74a6108ca567cb6e19ca202d3305e28..6dbae583ecc4f91e00e778eb9e38de63789d2b1b 100644 (file)
@@ -6024,7 +6024,7 @@ remattrmap_cmp(const void *v1, const void *v2)
        const RemoteAttributeMapping *r1 = v1;
        const RemoteAttributeMapping *r2 = v2;
 
-       return strncmp(r1->remote_attname, r2->remote_attname, NAMEDATALEN);
+       return strcmp(r1->remote_attname, r2->remote_attname);
 }
 
 /*