Link to home
Start Free TrialLog in
Avatar of VK
VK

asked on

how to set default trim for trailing spaces on strings/characters in POSTGRESSQL

How to set  default  trim for trailing spaces on strings/characters data in PostgresSQL

if you have string 'abc   '     it should 'abc'.   don't want to apply any trim functions manually on each query, Please advise.
Avatar of Michael Elliott
Michael Elliott
Flag of United States of America image

Hi VK, just to confirm, are you asking how to remove trailing spaces on strings/characters without using the TRIM() function?

Or are you just trying to trim all strings automatically each query?
Avatar of VK
VK

ASKER

Hi,  

Yes,  I don't want to use any trim function or any additional code, even though you have trailing spaces in the strings, these trailing spaces should trim automatically when saving in the database.  I mean, if query database without spaces i should get my results back even my my input data has spaces(trailing).  

In Netezza Postgres you have this feature, you  can check online.  It is really strange no one  tried to respond after so long time.

Thanks for asking.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.