Re: psql/pg_dump vs. dollar signs in identifiers - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: psql/pg_dump vs. dollar signs in identifiers
Date
Msg-id 87fy3xa1xw.fsf@oxford.xeocode.com
Whole thread Raw
In response to psql/pg_dump vs. dollar signs in identifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: psql/pg_dump vs. dollar signs in identifiers  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: psql/pg_dump vs. dollar signs in identifiers  ("Jim C. Nasby" <decibel@decibel.org>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> writes:

> Now, because we surround the pattern with ^...$ anyway, I can't offhand
> see a use-case for putting $ with its regexp meaning into the pattern.

It's possible to still usefully use $ in the regexp, but it's existence at the
end means there should always be a way to write the regexp without needing
another one inside.

Incidentally, are these really regexps? I always thought they were globs. 
And experiments seem to back up my memory:

postgres=# \d foo*   Table "public.foo^bar"Column |  Type   | Modifiers 
--------+---------+-----------i      | integer | 

postgres=# \d foo.*
Did not find any relation named "foo.*".


> Comments?

The first half of the logic applies to ^ as well. There's no use case for
regexps using ^ inside. You would have to use quotes to create the table but
we could have \d foo^* work:

postgres=# \d foo^*
Did not find any relation named "foo^*".


--  Gregory Stark EnterpriseDB          http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Warm standby stall -- what debug info would help?
Next
From: Tom Lane
Date:
Subject: Re: psql/pg_dump vs. dollar signs in identifiers