Thread: Re: [PATCHES] Double Backslash example patch
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)
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
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@candle.pha.pa.us | (610) 359-1001+ If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania19073
Alvaro Herrera <alvherre@dcc.uchile.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
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
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
Andrew Dunstan <andrew@dunslane.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
Tom Lane wrote: >Andrew Dunstan <andrew@dunslane.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