From: | Remigiusz Sokolowski <rems(at)gdansk(dot)sprint(dot)pl> |
---|---|
To: | Douglas Nichols <dnichols(at)fhcrc(dot)org> |
Cc: | pgsql-sql(at)postgreSQL(dot)org |
Subject: | Re: [SQL] Character type name?? How to lower case it? |
Date: | 1999-01-29 08:43:33 |
Message-ID: | Pine.GS4.4.02A.9901290932070.24590-100000@netra.gdansk.sprint.pl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
>
> I have this script:
> SELECT a.attname, t.typname, a.attlen
> FROM pg_class c, pg_attribute a, pg_type t
> WHERE c.relname = 'regis' and a.attname in
> ('var1','var2',var3');
>
> but a.attname is of type name, inwhich text(..) or lower(..)
> do not work with this type and I do not seem to be able to
> convert type name to text....
>
> Can someone help me get around this?
>
You could use case-insensitive regex operator - Your query should looks
like following:
SELECT a.attname, t.typname, a.attlen
FROM pg_class c, pg_attribute a, pg_type t
WHERE c.relname = 'regis' and (a.attname ~*'var1' OR
a.attname~*'var2' OR a.attname~*'var3');
May be this helps
Rem
-------------------------------------------------------------------*------------
Remigiusz Sokolowski e-mail: rems(at)gdansk(dot)sprint(dot)pl * *
-----------------------------------------------------------------*****----------
From | Date | Subject | |
---|---|---|---|
Next Message | Guido Goldstein | 1999-01-29 11:42:36 | Re: [SQL] Character type name?? How to lower case it? |
Previous Message | Vladimir Dobrokhotov | 1999-01-29 05:40:37 | index on int2. |