Skip site navigation (1) Skip section navigation (2)

Re: substring syntax with regexp

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: joseph speigle <joe(at)hovey(dot)hoveymotorcars(dot)com>,pgsql-general(at)postgresql(dot)org
Subject: Re: substring syntax with regexp
Date: 2004-06-30 15:13:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Wed, Jun 30, 2004 at 08:45:18AM -0500, joseph speigle wrote:
> hi,
> Does anybody know offhand what is the correct way to use substr to
> extract the domain name from a client_referer column as logged by
> mod_pgsqllog (httpd module), by correcting the following:

Nah, your problem is before the syntax of the substr function.  You have
to quote your single quotes in the function text.  So the relevant like
would look like

>                 newuri = substr(tempuri from ''http://[^/]*/.*'');

I didn't look at the rest of the function ...

Alvaro Herrera (<alvherre[a]>)
"Uno combate cuando es necesario... ¡no cuando está de humor!
El humor es para el ganado, o para hacer el amor, o para tocar el
baliset.  No para combatir."  (Gurney Halleck)

In response to

pgsql-general by date

Next:From: Thomas LeBlancDate: 2004-06-30 15:14:54
Subject: Running PostgreSQL on Windows 9x/2000/2003...
Previous:From: Tom LaneDate: 2004-06-30 14:52:06
Subject: Re: Slow dump with pg_dump/pg_restore ? How to improve ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group