Heikki Linnakangas <heikki.linnakan...@enterprisedb.com> wrote:

> Hmm, seems that dblink should call truncate_identifier() for the 
> truncation, to be consistent with truncation of table names etc.

Hmmm, we need the same routine with truncate_identifier(), but we hard
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:
> 
> >     /* 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 at 
> 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.

Regards,
---
Takahiro Itagaki
NTT Open Source Software Center

Attachment: dblink_63bytes-2010602.patch
Description: Binary data

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to