Re: Proposal for psql wildcarding behavior w/schemas - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal for psql wildcarding behavior w/schemas
Date
Msg-id 6165.1028611474@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal for psql wildcarding behavior w/schemas  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: Proposal for psql wildcarding behavior w/schemas
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Uh, if we follow the shell rules, quote-star-quote means star has no
> special meaning:

Interesting analogy.  We can't take it too far, because the shell quote
rules don't agree with SQL:

$ echo "aaa""zzz"
aaazzz

Under SQL rules the produced identifier would be aaa"zzz.  Still, this
provides some ammunition for not processing wildcard characters that
are within quotes.

>     $ echo \*
>     *

That analogy says we need to accept both quote and backslash quoting.
Not sure about this.  Again, SQL doesn't quite agree with the shell
about how these interact.  For example:

egression=# select "foo\bar";
ERROR:  Attribute "foo\bar" not found
regression=# \q
$ echo "foo\bar"
foar                              <--- \b went to backspace

So backslash isn't special within quotes according to SQL, but it
is according to the shell.

I still like "use the shell wildcards" as a rough design principle,
but the devil is in the details ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Proposal for psql wildcarding behavior w/schemas
Next
From: Hannu Krosing
Date:
Subject: Re: New manual chapters