Re: substring syntax with regexp - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: substring syntax with regexp
Date
Msg-id 20040630151324.GB15718@dcc.uchile.cl
Whole thread Raw
In response to substring syntax with regexp  (joseph speigle <joe.speigle@jklh.us>)
List 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]dcc.uchile.cl>)
"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)


pgsql-general by date:

Previous
From: "Thomas LeBlanc"
Date:
Subject: Running PostgreSQL on Windows 9x/2000/2003...
Next
From: Stephan Szabo
Date:
Subject: Re: substring syntax with regexp