]> granicus.if.org Git - postgresql/commitdiff
Avoid "identifier will be truncated" warning in dblink
authorItagaki Takahiro <itagaki.takahiro@gmail.com>
Wed, 9 Jun 2010 03:39:26 +0000 (03:39 +0000)
committerItagaki Takahiro <itagaki.takahiro@gmail.com>
Wed, 9 Jun 2010 03:39:26 +0000 (03:39 +0000)
when connection string is longer than NAMEDATALEN.
The previous fix for long connection name broke the behavior.

contrib/dblink/dblink.c

index b9ba4f9482d1c882498895e2dcba40e220f95d58..cc76b857acad58ecb26d6002a02597fe6a346aa3 100644 (file)
@@ -8,7 +8,7 @@
  * Darko Prenosil <Darko.Prenosil@finteh.hr>
  * Shridhar Daithankar <shridhar_daithankar@persistent.co.in>
  *
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.93 2010/06/09 00:56:02 itagaki Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.94 2010/06/09 03:39:26 itagaki Exp $
  * Copyright (c) 2001-2010, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
@@ -2399,7 +2399,7 @@ get_connect_string(const char *servername)
 
        /* first gather the server connstr options */
        srvname = pstrdup(servername);
-       truncate_identifier(srvname, strlen(srvname), true);
+       truncate_identifier(srvname, strlen(srvname), false);
        foreign_server = GetForeignServerByName(srvname, true);
 
        if (foreign_server)