John Siracusa <[EMAIL PROTECTED]> writes: > On 12/27/05 9:25 PM, Daniel Pittman wrote: >> To my great surprise, a 'varchar' column will truncate a long value if >> the 'length' argument is supplied, rather than reject it. > > Yeah, some people want truncation, some want a warning, and some want a > fatal error. I should make this configurable. Any ideas on an interface? > > foo => { type => 'varchar', length => 32, ??? => ??? }, > > Hm, overflow => truncate|warn|fatal?
That seems like a reasonable interface to me. It would also reasonably extend to non-string types, including fixed precision numeric columns, without needing to vary the interface significantly. >> Is there any reasonable way to alter this behaviour to what I expect, >> short of removing the length specification and allowing the database to >> fault at save time? > > You assume the db will fault! Some dbs will just truncate for you > too... ...well, if you want to be picky about it. ;) In my particular case, the database will fault, since PostgreSQL actually takes constraints seriously. Daniel ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object