Avoid "identifier will be truncated" warning in dblink
authorItagaki Takahiro <[email protected]>
Wed, 9 Jun 2010 03:40:16 +0000 (03:40 +0000)
committerItagaki Takahiro <[email protected]>
Wed, 9 Jun 2010 03:40:16 +0000 (03:40 +0000)
when connection string is longer than NAMEDATALEN.
The previous fix for long connection name broke the behavior.

contrib/dblink/dblink.c

index b9433fcaa4bd46685ea8f4448f1119e9d6403eaa..d0b19a8bab44a12a93d9561b6e2def5d089d06e2 100644 (file)
@@ -8,7 +8,7 @@
  * Darko Prenosil <[email protected]>
  * Shridhar Daithankar <[email protected]>
  *
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.82.2.4 2010/06/09 00:56:25 itagaki Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.82.2.5 2010/06/09 03:40:16 itagaki Exp $
  * Copyright (c) 2001-2009, PostgreSQL Global Development Group
  * ALL RIGHTS RESERVED;
  *
@@ -2437,7 +2437,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)