pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guido.Goldstein@t-online.de
To: Remigiusz Sokolowski <rems@gdansk.sprint.pl>
Cc: Douglas Nichols <dnichols@fhcrc.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: [SQL] Character type name?? How to lower case it?
Date: 29 Jan 1999 12:42:36 +0100
Message-ID: <lt3e4ui9ub.fsf@Guido.Goldstein.dialup.t-online.de> (raw)
References: <Pine.GS4.4.02A.9901290932070.24590-100000@netra.gdansk.sprint.pl>


Moin!

On Fri, 29 Jan 1999 09:43:33 +0100 (MET)
	Remigiusz Sokolowski <rems@gdansk.sprint.pl> wrote:
> > 
> > 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');

Why not
[...]
  WHERE c.relname = 'regis' and a.attname ~* 'var[1-3]'
[...]

It's a regex, remember?
The OR isn't necessary.

HIH
 &
HAND
  Guido
-- 
Monday is an awful way to spend 1/7th of your life.



view thread (7+ messages)  latest in thread

Message-ID: <lt3e4ui9ub.fsf@Guido.Goldstein.dialup.t-online.de>
Permalink:  ../lt3e4ui9ub.fsf@Guido.Goldstein.dialup.t-online.de/
Also on:    postgresql.org/message-id/lt3e4ui9ub.fsf@Guido.Goldstein.dialup.t-online.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: Guido.Goldstein@t-online.de, rems@gdansk.sprint.pl, dnichols@fhcrc.org
  Subject: Re: [SQL] Character type name?? How to lower case it?
  In-Reply-To: <lt3e4ui9ub.fsf@Guido.Goldstein.dialup.t-online.de>
  References: <Pine.GS4.4.02A.9901290932070.24590-100000@netra.gdansk.sprint.pl> <lt3e4ui9ub.fsf@Guido.Goldstein.dialup.t-online.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox