[Oledb-dev] [patch] parameterized varchar values containing >64 characters are not accepted by PostgreSQL

Victor Snezhko snezhko at indorsoft.ru
Wed May 3 07:24:53 UTC 2006


Hello!

  I have been searching what's wrong for several days and finally
figured it out. Here is the detailed problem description:

  The problem occurs when pgoledb receives parameterized query like
"UPDATE mytable SET str=? WHERE key=123" with the parameter of type
DBTYPE_WSTR. Inside FillInValues, we use GetOIDType for DBTYPE_WSTR,
and it returns 19. PostgreSQL type for oid 19 is "name", it's used to
store identifiers. Unfortunately, identifier length is limited to 64
characters and is a compile-time constant in PostgreSQL, ABI depends
on it. Therefore, at present pgoledb can't pass strings longer than 64
characters as parameters.

  The solution that doesn't involve SQL parsing (to figure out table
and column names to know their exact oids) is to move s_types_type
and s_types_oids entries that describe varchars in front of those
describing names, so that any DBTYPE_WSTR be passed as varchar, not
name. The patch is attached.

Any objections?

-- 
WBR, Victor V. Snezhko
E-mail: snezhko at indorsoft.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oledb-varchar.diff
Type: text/x-patch
Size: 2738 bytes
Desc: not available
Url : http://pgfoundry.org/pipermail/oledb-devel/attachments/20060503/35c5abea/attachment.bin 


More information about the Oledb-devel mailing list