On 02/06/10 09:46, Takahiro Itagaki wrote:
Heikki Linnakangaswrote:
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.
Heikki Linnakangaswrote:
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 hardtruncation, 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.
pass a palloc'd copy, allocated by text_to_cstring().
Should we throw a NOTICE like vanilla truncate_identifier() does?
I feel it would be better to just call truncate_identifier() than roll
your own. Assuming we want the same semantics in dblink, we'll otherwise
have to remember to update truncate_identifier_copy() with any changes
to truncate_identifier().