Re: [SQL] Character type name?? How to lower case it? - Mailing list pgsql-sql

From Remigiusz Sokolowski
Subject Re: [SQL] Character type name?? How to lower case it?
Date
Msg-id Pine.GS4.4.02A.9901290932070.24590-100000@netra.gdansk.sprint.pl
Whole thread Raw
In response to Character type name?? How to lower case it?  (Douglas Nichols <dnichols@fhcrc.org>)
List 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@gdansk.sprint.pl           * *
-----------------------------------------------------------------*****----------


pgsql-sql by date:

Previous
From: "Vladimir Dobrokhotov"
Date:
Subject: index on int2.
Next
From: Guido.Goldstein@t-online.de (Guido Goldstein)
Date:
Subject: Re: [SQL] Character type name?? How to lower case it?