How about:
SELECT distinct foo, length(foo) from bar where foobar like 'foobar%'
and foobar ~'^[0-9]*$';
I have a feeling that you may have an O in stead of a zero.
Tom Lane wrote:
>
> "Mario Weilguni" <mweilguni@sime.com> writes:
> > try:
> > SELECT distinct foo, length(foo) from bar where foobar like 'foobar%';
> > maybe one has a blank attached?
>
> He said the column was char(6), so they should all be padded to length
> 6. I was wondering about nonprinting characters (carriage returns etc)
> in the data, myself.
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html