pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedSubstrings by Regular Expression
3+ messages / 3 participants
[nested] [flat]
* Substrings by Regular Expression
@ 2003-11-14 17:02 Jim Drummey <drumeng@yahoo.com>
2003-11-19 20:42 ` Re: Substrings by Regular Expression Stephan Szabo <sszabo@megazone.bigpanda.com>
0 siblings, 1 reply; 3+ messages in thread
From: drumeng@yahoo.com @ 2003-11-14 17:02 UTC (permalink / raw)
To: pgsql-sql
Hello-
The 7.2 version distributed with RedHat 8.0 seems not
to work for substrings and POSIX regular expressions.
I think this should work....
pds=> select substring( str1 from ',' ) from address;
ERROR: pg_atoi: error in ",": can't parse ","
Am I missing something?
TIA
J. Drummey
drumeng@yahoo.com
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Substrings by Regular Expression
2003-11-14 17:02 Substrings by Regular Expression Jim Drummey <drumeng@yahoo.com>
@ 2003-11-19 20:42 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
2003-11-21 07:13 ` Re: Substrings by Regular Expression Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 3+ messages in thread
From: Stephan Szabo @ 2003-11-19 20:42 UTC (permalink / raw)
To: Jim Drummey <drumeng@yahoo.com>; +Cc: pgsql-sql
On Fri, 14 Nov 2003, Jim Drummey wrote:
> Hello-
>
> The 7.2 version distributed with RedHat 8.0 seems not
> to work for substrings and POSIX regular expressions.
>
> I think this should work....
>
> pds=> select substring( str1 from ',' ) from address;
> ERROR: pg_atoi: error in ",": can't parse ","
>
> Am I missing something?
That functionality was added in 7.3 I believe. You may wish
to upgrade.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Substrings by Regular Expression
2003-11-14 17:02 Substrings by Regular Expression Jim Drummey <drumeng@yahoo.com>
2003-11-19 20:42 ` Re: Substrings by Regular Expression Stephan Szabo <sszabo@megazone.bigpanda.com>
@ 2003-11-21 07:13 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 3+ messages in thread
From: Tom Lane @ 2003-11-21 07:13 UTC (permalink / raw)
To: Stephan Szabo <sszabo@megazone.bigpanda.com>; +Cc: Jim Drummey <drumeng@yahoo.com>; pgsql-sql
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
> On Fri, 14 Nov 2003, Jim Drummey wrote:
>> pds=> select substring( str1 from ',' ) from address;
>> ERROR: pg_atoi: error in ",": can't parse ","
>>
>> Am I missing something?
> That functionality was added in 7.3 I believe. You may wish
> to upgrade.
Also, it's worth noting that AFAICT the above is illegal per SQL99
--- the textual SUBSTRING variants the spec defines are
<character substring function> ::=
SUBSTRING <left paren> <character value expression> FROM <start position>
[ FOR <string length> ] <right paren>
<regular expression substring function> ::=
SUBSTRING <left paren> <character value expression> FROM
<character value expression> FOR
<escape character> <right paren>
so it looks to me like you can't omit "FOR <escape>" if you want to
adhere to the letter of the spec. We do allow omitting that clause
as a pretty-obvious extension ... but it's important to realize that
it *is* an extension.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-11-21 07:13 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-11-14 17:02 Substrings by Regular Expression Jim Drummey <drumeng@yahoo.com>
2003-11-19 20:42 ` Stephan Szabo <sszabo@megazone.bigpanda.com>
2003-11-21 07:13 ` Tom Lane <tgl@sss.pgh.pa.us>
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