psql & query string length

Started by Ansley, Michaelover 26 years ago5 messages
#1Ansley, Michael
Michael.Ansley@intec.co.za

Me, again...

In psql, is the \ that appears before a command supposed to terminate the
existing query line (if any), as well as escape the command from the query?
It seems that way, because anything after a \ command is ignored totally,
even another command. Once the command has been executed, that's it. Is
this the way that it's supposed to be?

Cheers...

MikeA

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ansley, Michael (#1)
Re: [HACKERS] psql & query string length

"Ansley, Michael" <Michael.Ansley@intec.co.za> writes:

In psql, is the \ that appears before a command supposed to terminate the
existing query line (if any), as well as escape the command from the query?

If you think that that logic needs rejiggering, be careful you don't
break \r (clear the query buffer, don't send the query) or \g (send
accumulated query, arranging to dump its output into a file). I think
there are some other backslash commands that interact with the query
accumulation buffer, as well.

I sort of thought that the basic idea is that backslash commands are
parsed and executed without any effect on the state of an incompletely
entered query, except when the specific backslash command is defined to
do something with the query buffer. I might be all wet though.

If you got distracted by this point while working on making the query
buffer indefinitely extensible, I'd counsel fixing one bug at a time...

regards, tom lane

#3Vince Vielhaber
vev@michvhf.com
In reply to: Tom Lane (#2)
Re: [HACKERS] psql & query string length

On Tue, 20 Jul 1999, Tom Lane wrote:

I sort of thought that the basic idea is that backslash commands are
parsed and executed without any effect on the state of an incompletely
entered query, except when the specific backslash command is defined to
do something with the query buffer. I might be all wet though.

That's the way it works here Tom, so you shouldn't be needing a towel :)

Vince.
--
==========================================================================
Vince Vielhaber -- KA8CSH email: vev@michvhf.com flame-mail: /dev/null
# include <std/disclaimers.h> TEAM-OS2
Online Campground Directory http://www.camping-usa.com
Online Giftshop Superstore http://www.cloudninegifts.com
==========================================================================

#4Ansley, Michael
Michael.Ansley@intec.co.za
In reply to: Vince Vielhaber (#3)
RE: [HACKERS] psql & query string length

Tom Lane wrote:

buffer indefinitely extensible, I'd counsel fixing one bug
at a time...

I know, you're right.
I'm not trying to fix it, though, only trying to work out what it is
supposed to do in certain circumstances.

MikeA

#5Ansley, Michael
Michael.Ansley@intec.co.za
In reply to: Ansley, Michael (#4)
RE: [HACKERS] psql & query string length

In order not to break it. I could just run the regression tests, I suppose,
but it always helps if you kind of know where you're going.

Show quoted text

-----Original Message-----
From: Ansley, Michael [mailto:Michael.Ansley@intec.co.za]
Sent: Tuesday, July 20, 1999 5:30 PM
To: 'pgsql-hackers@postgresql.org'
Subject: RE: [HACKERS] psql & query string length

Tom Lane wrote:

buffer indefinitely extensible, I'd counsel fixing one bug
at a time...

I know, you're right.
I'm not trying to fix it, though, only trying to work out what it is
supposed to do in certain circumstances.

MikeA