From: CG <cgg007@yahoo.com>
To: pgsql-odbc@postgresql.org
Subject: Value truncation on user defined type
Date: Wed, 9 May 2007 10:08:33 -0700 (PDT)
Message-ID: <628526.98267.qm@web37911.mail.mud.yahoo.com> (raw)
I've finally taken the plunge and upgraded PgODBC from 7.03.02.00 to 8.02.04.00 ... I'm having an issue with data truncation on the uniqueidentifier type (http://gborg.postgresql.org/project/uniqueidentifier/projdisplay.php) ...
'in ASP vbScript....
dim conn, sql, rs, newUUID
set conn = server.createobject("adodb.connection")
conn.open("Provider=MSDASQL.1;Password=pass;Persist Security Info=True;User Id=user;Mode=ReadWrite;" & _
"Extended Properties=""DRIVER={PostgreSQL ANSI};" & _
"DATABASE=data;SERVER=10.0.0.2;PORT=5432;UID=user;PWD=pass;" & _
"SSLmode=disable;ReadOnly=0;Protocol=7.4-1;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;" & _
"ShowSystemTables=0;ConnSettings=set+sort%5Fmem%3D10241%3Bset+geqo%3Don%3B;Fetch=300;Socket=4096;" & _
"UnknownSizes=0;MaxVarcharSize=254;" & _
"MaxLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=1;Ksqo=1;UseDeclareFetch=0;TextAsLongVarchar=1;" & _
"UnknownsAsLongVarchar=0;BoolsAsChar=1;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;;LFConversion=1;" & _
"UpdatableCursors=1;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=1;" & _
"LowerCaseIdentifier=0;XaOpt=1""")
sql = "select newid() as uuid;"
set rs = conn.execute(sql)
newUUID = rs("uuid").value
response.write ("Length : " & len(newUUID) & "<BR>" & vbcrlf)
response.write ("Type : " & vartype(newUUID) & "<BR>" & vbcrlf)
response.write ("<table border=""1"">")
for i = 1 to len(newUUID)
response.write ("<tr><td>" & asc(mid(newUUID,i,1)) & "</td><td>" & server.htmlencode(mid(newUUID,i,1)) & "</td></tr>" & vbcrlf)
next
response.write ("</table>")
rs.close
set rs = nothing
conn.close
set conn = nothing
The returned value is the correct length, but there must be a null inserted after the 16th character becasuse the return value, which is a string type, abruptly terminates at that point.
If I cast the uuid to type text, nothing gets truncated. This wasn't a problem in 7.03.02.00 ...
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: cgg007@yahoo.com
Subject: Re: Value truncation on user defined type
In-Reply-To: <628526.98267.qm@web37911.mail.mud.yahoo.com>
References: <628526.98267.qm@web37911.mail.mud.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox