Re: psql/pg_dump vs. dollar signs in identifiers

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: psql/pg_dump vs. dollar signs in identifiers
Date: 2007-07-09 18:04:27
Message-ID: 87fy3xa1xw.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-07-09 18:21:32 Re: psql/pg_dump vs. dollar signs in identifiers
Previous Message Kevin Grittner 2007-07-09 17:43:42 Re: Warm standby stall -- what debug info would help?