Heikki Linnakangas wrote:
Hmm, seems that dblink should call truncate_identifier() for the
truncation, to be consistent with truncation of table names etc.
Hmm, seems that dblink should call truncate_identifier() for the
truncation, to be consistent with truncation of table names etc.
to use the function because it modifies the input buffer directly.
Since all of the name strings in dblink is const char *, I added
a bit modified version of the function as truncate_identifier_copy()
in the attached v2 patch.
I also spotted this in dblink.c:
creation and at use, so that if you create an object with a very long
name and it's truncated, you can still refer to it with the untruncated
name because all such references are truncated too.
Absolutely. I re-use the added function for the fix./* first gather the server connstr options */
if (strlen(servername) < NAMEDATALEN)
foreign_server = GetForeignServerByName(servername, true);
I think that's wrong. We normally consistently truncate identifiers atif (strlen(servername) < NAMEDATALEN)
foreign_server = GetForeignServerByName(servername, true);
creation and at use, so that if you create an object with a very long
name and it's truncated, you can still refer to it with the untruncated
name because all such references are truncated too.
Regards,
---
Takahiro Itagaki
NTT Open Source Software Center