Forum OpenACS Development: Re: db_string fails for large text columns

Collapse
Posted by Dave Bauer on
I think a little more information is needed?

Can you paste the code you tried to use, and the error message that occured when it "failed"?

db_string is for selecting text only, and I do not know of any issues with selecting large text from postgresql with db_string.

2000 characters is not a large string really at least not ar far as postgresql is concerned.

Collapse
Posted by Ryan Gallimore on
Here's the error message:

Error: POST http://site.com/acknowledgements/admin/details?
referred by "http://site.com/acknowledgements/admin/details";
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")

ERROR: value too long for type character varying(2000)
CONTEXT: SQL statement "update acknowledgments set shortname = $1 , title = $2 , description = $3 , global_p = $4 \
, ack_mode = $5 , ack_phrase = $6 , group_id = $7 , due_date = $8 where ack_id = $9 "
PL/pgSQL function "acknowledgment__edit" line 13 at SQL statement

SQL: select acknowledgment__edit('1','terms_of_use','Terms of Use','<div class=Section1>...[28K characters]...','f','checkbox',NULL,'-2',NULL)
while executing
"ns_pg_bind 0or1row nsdb0 {select acknowledgment__edit(:ack_id,:shortname,:title,:description,:global_p,:mode,:phrase,:\
group_id,:date)}"
("uplevel" body line 1)
invoked from within
"uplevel $ulevel [list ns_pg_bind $type $db $sql]"
("postgresql" arm line 2)
invoked from within
"switch $driverkey {
oracle {
return [uplevel $ulevel [list ns_ora $type $db $sql] $args]
}
..."