Received: from mailout07.btx.dtag.de (mailout07.btx.dtag.de [194.25.2.155]) by hub.org (8.9.2/8.9.1) with SMTP id GAA89467 for ; Fri, 29 Jan 1999 06:44:59 -0500 (EST) (envelope-from Guido.Goldstein@t-online.de) Received: from fwd01.btx.dtag.de (fwd01.btx.dtag.de [194.25.2.161]) by mailout07.btx.dtag.de with smtp id 106CKY-0004QY-00; Fri, 29 Jan 1999 12:43:22 +0100 Received: from seneca.nugget-soft.de (049347522-0001(btxid)@[62.156.8.36]) by fwd01.btx.dtag.de with smtp id ; Fri, 29 Jan 1999 12:42:39 +0100 Received: by seneca via sendmail from stdin id (Debian Smail3.2.0.101) for dnichols@fhcrc.org; Fri, 29 Jan 1999 12:42:37 +0100 (CET) To: Remigiusz Sokolowski Cc: Douglas Nichols , pgsql-sql@postgresql.org Subject: Re: [SQL] Character type name?? How to lower case it? References: X-Alignment: chaotic In-Reply-To: Remigiusz Sokolowski's message of "Fri, 29 Jan 1999 09:43:33 +0100 (MET)" Date: 29 Jan 1999 12:42:36 +0100 Message-ID: Lines: 40 X-Mailer: Gnus v5.5/XEmacs 20.4 - "Emerald" X-Sender: 049347522-0001@t-online.de From: Guido.Goldstein@t-online.de (Guido Goldstein) Moin! On Fri, 29 Jan 1999 09:43:33 +0100 (MET) Remigiusz Sokolowski 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.