dbTalk Databases Forums  

[BUGS] BUG #2643: Auto trim on insert and update

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2643: Auto trim on insert and update in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Neely
 
Posts: n/a

Default [BUGS] BUG #2643: Auto trim on insert and update - 09-24-2006 , 04:15 PM







The following bug has been logged online:

Bug reference: 2643
Logged by: Gene Neely
Email address: paul.neely (AT) comcast (DOT) net
PostgreSQL version: 8.0.x 8.1.x
Operating system: Linux
Description: Auto trim on insert and update
Details:

THIS IS NOT A BUG, but a request. Found no place else to submit.
I have found no way to automatically trim fields to the length of the
varchar or char on inserts and updates.
I have tried to create check rules to trim to the varchar length with not
luck.
Can this become a Configuration option???
Doing trims of every variable at every sql command execution takes a lot of
time both coding and lookup the columns length.
Thanks.
Gene Neely

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote
  #2  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] BUG #2643: Auto trim on insert and update - 09-24-2006 , 06:27 PM






"Gene Neely" <paul.neely (AT) comcast (DOT) net> writes:
Quote:
I have found no way to automatically trim fields to the length of the
varchar or char on inserts and updates.
Write an explicit cast to varchar(N) or whatever it is.

Quote:
Can this become a Configuration option???
No, because the behavior is required by the SQL standard.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.