Hello Zopistas: I'm trying to read (and later probably write) large strings to a postgress database. I'm using the egenix ODBC adapter, and the unix ODBC postgress driver. When I read a column with 20,000+ characters I only get the first 8194 characters. Is this: 1) a Zope restriction? 2) a UnixOdbc restriction? 3) a egenix ODBC restriction? 4) an ODBC protocol restiction? Thanks for any of the above answers.... Jerry Westrick
On Fri, Aug 08, 2003 at 04:04:14AM +0200 - a wonderful day - Jerry Westrick wrote:
I'm trying to read (and later probably write) large strings to a postgress database.
I'm using the egenix ODBC adapter, and the unix ODBC postgress driver.
When I read a column with 20,000+ characters I only get the first 8194 characters.
Is this: 1) a Zope restriction? No. No I guess not (see below first)
2) a UnixOdbc restriction? No. I guess not (see below first)
3) a egenix ODBC restriction? No. I guess not (see below first)
4) an ODBC protocol restiction? No. I guess not (see below first)
What about PostgreSQL. Which Version? A short glimpse at the online postgresql manual - namely at http://www.postgresql.org/docs/7.2/static/datatype-character.html yields: """Note: Prior to PostgreSQL 7.2, strings that were too long were silently truncated, no error was raised. """ Ok, looking at the online docs of one of those prior versions is left as an exercise to the poster. But since such a few kilobyte limit isn't exactly what everyone likes, I wouldn't be to surprised, if the exact amount is nurried somwewhere ... Are those 20000+ characters really in the database? Hint: psql is a friend. All the best, Stefan Drees. -- Stefan Drees, sdrees@python.net, www.sdrees.biz Fingerprint = 516C C4EF 712A B26F 15C9 C7B7 5651 6964 D508 1B56
Stefan... Muchachas Graciosas! Um, yes the 20000+ characters are really in the database (as seen with PGADMIN II) and confirmed with "select length(contents) from files" hmmm, but I'm glad to hear all the no's, maybe I'll find a work around then... Back to inserting debug print statements.... On Fri, 2003-08-08 at 10:02, Stefan Drees wrote:
On Fri, Aug 08, 2003 at 04:04:14AM +0200 - a wonderful day - Jerry Westrick wrote:
I'm trying to read (and later probably write) large strings to a postgress database.
I'm using the egenix ODBC adapter, and the unix ODBC postgress driver.
When I read a column with 20,000+ characters I only get the first 8194 characters.
Is this: 1) a Zope restriction? No. No I guess not (see below first)
2) a UnixOdbc restriction? No. I guess not (see below first)
3) a egenix ODBC restriction? No. I guess not (see below first)
4) an ODBC protocol restiction? No. I guess not (see below first)
What about PostgreSQL. Which Version? A short glimpse at the online postgresql manual - namely at http://www.postgresql.org/docs/7.2/static/datatype-character.html yields: """Note: Prior to PostgreSQL 7.2, strings that were too long were silently truncated, no error was raised. """ Ok, looking at the online docs of one of those prior versions is left as an exercise to the poster. But since such a few kilobyte limit isn't exactly what everyone likes, I wouldn't be to surprised, if the exact amount is nurried somwewhere ...
Are those 20000+ characters really in the database? Hint: psql is a friend.
All the best, Stefan Drees.
On Fri, Aug 08, 2003 at 11:50:19AM +0200 - a wonderful day - Jerry Westrick wrote:
On Fri, 2003-08-08 at 10:02, Stefan Drees wrote:
On Fri, Aug 08, 2003 at 04:04:14AM +0200 - a wonderful day - Jerry Westrick wrote:
I'm trying to read (and later probably write) large strings to a postgress database.
I'm using the egenix ODBC adapter, and the unix ODBC postgress driver.
When I read a column with 20,000+ characters I only get the first 8194 characters. ... any (minimal code?) didi you try to fire up another of those unknown readcalls? See below ...
Is this: 1) a Zope restriction? No. No I guess not (see below first) 2) a UnixOdbc restriction? No. I guess not (see below first) 3) a egenix ODBC restriction? No. I guess not (see below first) 4) an ODBC protocol restiction? No. I guess not (see below first) ... Are those 20000+ characters really in the database? Hint: psql is a friend. Um, yes the 20000+ characters are really in the database (as seen with PGADMIN II)
and confirmed with "select length(contents) from files"
hmmm, but I'm glad to hear all the no's, maybe I'll find a work around then...
Back to inserting debug print statements.... ... or reading the API docs? Something like 8kb seems like a nice first guess buffer size ;) probably you have to iterate those read calls to get all data? Just guessing.
Ah yes, and be aware my "No. I guess not"s take into account, that You did not state some minimal code, so someone more fluent with these APIs could have a guess ... All the best, Stefan Drees. -- Stefan Drees, sdrees@python.net, www.sdrees.biz Fingerprint = 516C C4EF 712A B26F 15C9 C7B7 5651 6964 D508 1B56
On Fri, Aug 08, 2003 at 10:02:19AM +0200, Stefan Drees wrote: | On Fri, Aug 08, 2003 at 04:04:14AM +0200 - a wonderful day | - Jerry Westrick wrote: [...] | > When I read a column with 20,000+ characters I only get the first | > 8194 characters. [...] | What about PostgreSQL. Which Version? | A short glimpse at the online postgresql manual - namely at | http://www.postgresql.org/docs/7.2/static/datatype-character.html | yields: | """Note: Prior to PostgreSQL 7.2, strings that were too | long were silently truncated, no error was raised. | """ What data type? I suspect the above quote refers to inserting a VARCHAR. I know that the 'TEXT' type allows up to 2GB. Also check the settings of both the zope adapter and the ODBC driver. ISTR a buffer limit setting somewhere (but I haven't worked with any of that recently). HTH, -D -- Love is not affectionate feeling, but a steady wish for the loved person's ultimate good as far as it can be obtained. --C.S. Lewis http://dman13.dyndns.org/~dman/
I'm trying to read (and later probably write) large strings to a postgress database. ... When I read a column with 20,000+ characters I only get the first 8194 characters.
Is this: 1) a Zope restriction?
This is a very unlikely cause, but I recall that certain Python data structures (files?) may look like strings up to a certain point, but then contain a link to another node with more data. You can get the whole of the contents by str(the_thing). But them, you're probably using the string type already. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
participants (4)
-
Derrick 'dman' Hudson -
J Cameron Cooper -
Jerry Westrick -
Stefan Drees