[HACKERS] psql/pg_dump vs. dollar signs in identifiers

2007-07-09 Thread Tom Lane
An example being discussed on the jdbc list led me to try this: regression=# create table a$b$c (f1 int); CREATE TABLE regression=# \d a$b$c Did not find any relation named a$b$c. It works if you use quotes: regression=# \d a$b$c Table public.a$b$c Column | Type | Modifiers

Re: [HACKERS] psql/pg_dump vs. dollar signs in identifiers

2007-07-09 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] 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

Re: [HACKERS] psql/pg_dump vs. dollar signs in identifiers

2007-07-09 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Incidentally, are these really regexps? I always thought they were globs. They're regexps under the hood, but we treat . as a schema separator and translate * to .*, which makes it look like mostly a glob scheme. But you can make use of brackets, |, +,

Re: [HACKERS] psql/pg_dump vs. dollar signs in identifiers

2007-07-09 Thread Jim C. Nasby
On Mon, Jul 09, 2007 at 07:04:27PM +0100, Gregory Stark wrote: Tom Lane [EMAIL PROTECTED] 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

Re: [HACKERS] psql/pg_dump vs. dollar signs in identifiers

2007-07-09 Thread Gregory Stark
Jim C. Nasby [EMAIL PROTECTED] writes: Unless you're doing muti-line regex, what's the point of a $ anywhere but the end of the expression? Am I missing something? Likewise with ^. Leaving out the backslashes, you can do things like (foo$|baz|qux)(baz|qux|) to say that all 9 combinations of