Search Postgresql Archives

Re: Checking for string data that makes sense Re: postgresql vs mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zoltan Boszormenyi wrote:

I would do a CHECK (trim(a) <> '')



If you were ok with a string consisting soley of whitespace.


I meant NOT NULL CHECK(trim(a) <> ''), keeping the context of the
above example.

Right. I plead that it was late when i replied. I honestly don't know
what i was thinking.

trim() trims whitespace only from the beginning and the end of the
strings but not from the middle:

# select trim('   a b c   ');

I realise that. I was thinking of this case:

select trim('        ');

Though, i'm not sure what my point was. Again, it was late. Carry on!

brian


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux