Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: [Q] UTF-8 testing with Windows/ODBC 8.3.0400



thank you,
I have a follow up:

I if I declare a field as varchar(30)
in the UTF-8 Postgres, I assume it can possibly be more than 30 bytes
storage.


so when I set the ODBCs (unicode version)  'max long varchar'
am I setting it to max 'byte length' of the UTF-8 (as in the dabase)
or to '60' (max number of bytes for 30 character string in UTF-16)
or to '30' (max number of valid characters) ?


And would your answer be the same for the unix Odbc version ?


Thank you again for the response,
Vlad



On Thu, 19 Mar 2009 21:28 +0900, "Hiroshi Inoue" <inoue(at)tpf(dot)co(dot)jp>
wrote:
> V S P wrote:
> > Hi thank you for the follow up.
> > Just had a break through... 
> 
> <snip>
> 
> > Three things that I am not still sure about, and may be you can help:
> > 
> > a) does Posgtres driver on unixODBC do the same as Windows (that is
> > there is a unicode and non unicode versions of the drivers ?
> > (I am interested in 64 bit linux and 64 bit freebsd ones)
> > 
> > b) I noticed that when using the Unicode version (first) and 
> > Ascii version (second) the value of SWORD right before SQLVLEN is
> > different
> > (it is 12 on the ascii and -9 on unicode version) -- what does this
> > mean?
> 
> It's the SQL data type. 12 means SQL_VARCHAR and -9 means SQL_WVARCHAR.
> 
> > disp_otrq_x86d  8a4-b90 EXIT  SQLDescribeColW  with return code 0
> > (SQL_SUCCESS)
> > 		HSTMT               013F1BA8
> > 		UWORD                       11 
> > 		WCHAR *             0x01A28974 [       9] "cntr_data"
> > 		SWORD                      512 
> > 		SWORD *             0x01A28BC4 (9)
> > 		SWORD *             0x01A28BB8 (-9)
> > 		SQLULEN *           0x01A28B94 (4096)
> > 		SWORD *             0x01A28BA0 (0)
> > 		SWORD *             0x01A28B88 (1)
> > 
> > 
> > disp_otrq_x86d  ab8-498 EXIT  SQLDescribeColW  with return code 0
> > (SQL_SUCCESS)
> > 		HSTMT               013F1C38
> > 		UWORD                       11 
> > 		WCHAR *             0x01A28974 [       9] "cntr_data"
> > 		SWORD                      512 
> > 		SWORD *             0x01A28BC4 (9)
> > 		SWORD *             0x01A28BB8 (12)
> > 		SQLULEN *           0x01A28B94 (4096)
> > 		SWORD *             0x01A28BA0 (0)
> > 		SWORD *             0x01A28B88 (1)
> 
> > another  question:  I have about 6 tables where about 20 fields in each
> > table,
> > 2 fields are 65K long (they are declared as varchar(65000) is this is OK
> > for ODBC drivers, and what if anything I should be setting on them?
> 
> 65K may be OK if you set the max long varchar size > 65000 but please
> note that most applications/middlewares have their own limitation.
> For example the limitation of MS Access is around 65000 AFAIR.
> 
> regards,
> Hiroshi Inoue
-- 
  V S P
  toreason(at)fastmail(dot)fm

-- 
http://www.fastmail.fm - A fast, anti-spam email service.




Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group