Lists: | pgsql-hackerspgsql-patches |
---|
From: | David Fetter <david(at)fetter(dot)org> |
---|---|
To: | PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Double Backslash example patch |
Date: | 2003-12-07 01:53:07 |
Message-ID: | 20031207015307.GV9190@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Kind people,
Please find enclosed a patch exemplifying typical use of the ARE
Class-Shorthand Escapes®. I believe it will help intrepid regex
users. :)
Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 cell: +1 415 235 3778
Attachment | Content-Type | Size |
---|---|---|
are_example.diff | text/plain | 1.1 KB |
From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | David Fetter <david(at)fetter(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-07 09:53:44 |
Message-ID: | 200312071053.44489.peter_e@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
David Fetter wrote:
> Please find enclosed a patch exemplifying typical use of the ARE
> Class-Shorthand Escapes®. I believe it will help intrepid regex
> users. :)
If you want to explain something, it's normally better to create an
example just for that point, instead of piggybacking it onto another
example. Else you just make it harder for people to recognize the
relevant information.
For instance, in the case you want to patch the example aims to show how
patterns are not anchored, as opposed to the pattern for the LIKE
operator. What does the escape syntax of the pattern have to do with
that?
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | David Fetter <david(at)fetter(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-16 01:22:50 |
Message-ID: | 200312160122.hBG1Mod19303@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Peter Eisentraut wrote:
> David Fetter wrote:
> > Please find enclosed a patch exemplifying typical use of the ARE
> > Class-Shorthand Escapes??. I believe it will help intrepid regex
> > users. :)
>
> If you want to explain something, it's normally better to create an
> example just for that point, instead of piggybacking it onto another
> example. Else you just make it harder for people to recognize the
> relevant information.
>
> For instance, in the case you want to patch the example aims to show how
> patterns are not anchored, as opposed to the pattern for the LIKE
> operator. What does the escape syntax of the pattern have to do with
> that?
He is reminding folks about double-backslashes in a relivant place ---
makes sense to me.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-16 01:22:53 |
Message-ID: | 200312160122.hBG1Mrj19310@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Your patch has been added to the PostgreSQL unapplied patches list at:
http://momjian.postgresql.org/cgi-bin/pgpatches
I will try to apply it within the next 48 hours.
---------------------------------------------------------------------------
David Fetter wrote:
> Kind people,
>
> Please find enclosed a patch exemplifying typical use of the ARE
> Class-Shorthand Escapes. I believe it will help intrepid regex
> users. :)
>
> Cheers,
> D
> --
> David Fetter david(at)fetter(dot)org http://fetter.org/
> phone: +1 510 893 6100 cell: +1 415 235 3778
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From: | "Peter Eisentraut" <peter_e(at)gmx(dot)net> |
---|---|
To: | <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | <david(at)fetter(dot)org>, <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-16 09:05:23 |
Message-ID: | 32852.137.226.116.18.1071565523.squirrel@new.host.name |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian writes:
>
> Your patch has been added to the PostgreSQL unapplied patches list at:
>
> http://momjian.postgresql.org/cgi-bin/pgpatches
>
> I will try to apply it within the next 48 hours.
Please don't.
Add a new example if you want, but don't overload existing examples with
unrelated information.
>
> ---------------------------------------------------------------------------
>
>
> David Fetter wrote:
>> Kind people,
>>
>> Please find enclosed a patch exemplifying typical use of the ARE
>> Class-Shorthand Escapes®. I believe it will help intrepid regex
>> users. :)
>>
>> Cheers,
>> D
>> --
>> David Fetter david(at)fetter(dot)org http://fetter.org/
>> phone: +1 510 893 6100 cell: +1 415 235 3778
>
> [ Attachment, skipping... ]
>
>>
>> ---------------------------(end of
>> broadcast)--------------------------- TIP 4: Don't 'kill -9' the
>> postmaster
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania
> 19073
From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | David Fetter <david(at)fetter(dot)org>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-16 15:32:37 |
Message-ID: | 200312161632.37763.peter_e@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian wrote:
> He is reminding folks about double-backslashes in a relivant place
> --- makes sense to me.
The relevant place would be far below where it already says:
Note: Keep in mind that an escape's leading \ will need to be doubled
when entering the pattern as an SQL string constant.
So it's already covered.
From: | David Fetter <david(at)fetter(dot)org> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-16 19:17:11 |
Message-ID: | 20031216191711.GJ19694@fetter.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | Postg토토 결과SQL pgsql-patches |
On Tue, Dec 16, 2003 at 04:32:37PM +0100, Peter Eisentraut wrote:
> Bruce Momjian wrote:
> > He is reminding folks about double-backslashes in a relivant place
> > --- makes sense to me.
>
> The relevant place would be far below where it already says:
>
> Note: Keep in mind that an escape's leading \ will need to be
> doubled when entering the pattern as an SQL string constant.
>
> So it's already covered.
With all due respect, Peter, it is only implicit in the docs, and that
is not always good enough. An explicit example will help, as
PostgreSQL's quoting system would qualify for an early place on the
'gotchas' page (cf. http://sql-info.de/mysql/gotchas.html) if
PostgreSQL had one.
Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 cell: +1 415 235 3778
From: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-16 19:31:36 |
Message-ID: | 20031216193136.GB13916@dcc.uchile.cl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Tue, Dec 16, 2003 at 11:17:11AM -0800, David Fetter wrote:
[Moved to hackers -- this belongs to -docs anyway, doesn't it?]
> With all due respect, Peter, it is only implicit in the docs, and that
> is not always good enough. An explicit example will help, as
> PostgreSQL's quoting system would qualify for an early place on the
> 'gotchas' page (cf. http://sql-info.de/mysql/gotchas.html) if
> PostgreSQL had one.
BTW, what happened to the $QUOTE$ quoting idea? Was it applied, or
even developed?
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"The problem with the future is that it keeps turning into the present"
(Hobbes)
From: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-16 19:32:52 |
Message-ID: | 200312162032.52080.peter_e@gmx.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
David Fetter wrote:
> With all due respect, Peter, it is only implicit in the docs, and
> that is not always good enough. An explicit example will help, as
Sure, I'm just pointing out the most appropriate place to put it.
From: | Jon Jensen <jon(at)endpoint(dot)com> |
---|---|
To: | Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-16 20:18:34 |
Message-ID: | Pine.LNX.4.58.0312162018010.1582@louche.swelter.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
On Tue, 16 Dec 2003, Alvaro Herrera wrote:
> BTW, what happened to the $QUOTE$ quoting idea? Was it applied, or
> even developed?
I believe it's still on the to-do list, but was pushed off until 7.5 or
whenever it gets done.
Jon
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
Cc: | David Fetter <david(at)fetter(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-17 01:06:49 |
Message-ID: | 200312170106.hBH16nb24604@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Alvaro Herrera wrote:
> On Tue, Dec 16, 2003 at 11:17:11AM -0800, David Fetter wrote:
>
> [Moved to hackers -- this belongs to -docs anyway, doesn't it?]
>
> > With all due respect, Peter, it is only implicit in the docs, and that
> > is not always good enough. An explicit example will help, as
> > PostgreSQL's quoting system would qualify for an early place on the
> > 'gotchas' page (cf. http://sql-info.de/mysql/gotchas.html) if
> > PostgreSQL had one.
>
> BTW, what happened to the $QUOTE$ quoting idea? Was it applied, or
> even developed?
Not implemented yet.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
Cc: | David Fetter <david(at)fetter(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-17 08:25:03 |
Message-ID: | 26067.1071649503@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> writes:
> BTW, what happened to the $QUOTE$ quoting idea? Was it applied, or
> even developed?
I'd like to see it done for 7.5, but haven't personally had time to go
further than the proof-of-concept backend patch I posted awhile ago.
I think the minimum amount of additional work that has to be done before
we can apply it is to teach psql's input parser about $QUOTE$ ---
without that, the feature is not only useless but counterproductive.
After that we could get on with teaching pg_dump and other stuff about
it, at our leisure.
Any volunteers to fix psql?
regards, tom lane
From: | Andreas Pflug <pgadmin(at)pse-consulting(dot)de> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-17 13:57:29 |
Message-ID: | 3FE060C9.30606@pse-consulting.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
>
>I think the minimum amount of additional work that has to be done before
>we can apply it is to teach psql's input parser about $QUOTE$ ---
>without that, the feature is not only useless but counterproductive.
>
>
IMHO it's not useless. pgAdmin already knows that quoting scheme... not
yet tested, I'll have to check that patch.
Regards,
Andreas
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | |
Cc: | Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-17 17:12:11 |
Message-ID: | 3FE08E6B.2020200@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Andreas Pflug wrote:
> Tom Lane wrote:
>
>>
>> I think the minimum amount of additional work that has to be done before
>> we can apply it is to teach psql's input parser about $QUOTE$ ---
>> without that, the feature is not only useless but counterproductive.
>>
>>
> IMHO it's not useless. pgAdmin already knows that quoting scheme...
> not yet tested, I'll have to check that patch.
>
OTOH we sure want it for psql - being able to use this in scripts fed to
psql is very important IMNSHO.
I see that psql/mainloop.c contains this comment:
* FIXME: rewrite this whole thing with flex
Is now the time to do that? It would be a pity if substantial changes
were made here only to be thrown away ...
cheers
andrew
From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
Cc: | Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-17 18:07:35 |
Message-ID: | 8692.1071684455@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I see that psql/mainloop.c contains this comment:
> * FIXME: rewrite this whole thing with flex
> Is now the time to do that?
If you feel like giving it a shot, ain't nobody gonna stand in your way.
MainLoop() is well past the level of unmaintainability IMHO (which is
why I'd not tried to touch it in the original quick patch).
I'm not totally convinced that flex can do the job, but in any case a
ground-up redesign for legibility might be the only cure.
regards, tom lane
From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
---|---|
To: | |
Cc: | Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Double Backslash example patch |
Date: | 2003-12-17 18:49:31 |
Message-ID: | 3FE0A53B.6020704@dunslane.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
Tom Lane wrote:
>Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>
>>I see that psql/mainloop.c contains this comment:
>> * FIXME: rewrite this whole thing with flex
>>Is now the time to do that?
>>
>>
>
>If you feel like giving it a shot, ain't nobody gonna stand in your way.
>MainLoop() is well past the level of unmaintainability IMHO (which is
>why I'd not tried to touch it in the original quick patch).
>
>I'm not totally convinced that flex can do the job, but in any case a
>ground-up redesign for legibility might be the only cure.
>
>
>
I will take a look - no guarantees though. I agree that flex might well
end up making things more obscure than less.
Keeping track of open quote operators to make sure we have proper
nesting and closing looks like it might be a bit messy, but doable.
cheers
andrew
From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | David Fetter <david(at)fetter(dot)org> |
Cc: | PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Double Backslash example patch |
Date: | 2003-12-18 03:58:46 |
Message-ID: | 200312180358.hBI3wkj00743@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers pgsql-patches |
I have applied your additional example in the place Peter suggested.
Patch attached.
---------------------------------------------------------------------------
David Fetter wrote:
> Kind people,
>
> Please find enclosed a patch exemplifying typical use of the ARE
> Class-Shorthand Escapes. I believe it will help intrepid regex
> users. :)
>
> Cheers,
> D
> --
> David Fetter david(at)fetter(dot)org http://fetter.org/
> phone: +1 510 893 6100 cell: +1 415 235 3778
[ Attachment, skipping... ]
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/plain | 885 bytes |