Re: Disparity in search_path SHOW and SET
Bruce Momjian <pgman@candle.pha.pa.us>
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Greg Sabino Mullane <greg@turnstep.com>
Cc: PostgreSQL-patches <pgsql-patches@postgresql.org>
Date: 2005-12-22T23:57:19Z
Lists: pgsql-hackers
Attachments
- (unnamed) (text/plain)
Greg Sabino Mullane wrote: [ There is text before PGP section. ] > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > > Well, sure, because you told it to. Why isn't the last parameter "false"? > > Thanks. I knew I was overlooking something. I've obviously been staring at > the code too long. :) Still, would it make more sense for SHOW search_path > to return this: > > "$user",public Agreed. I have gotten confused on how to set $user in the past. I have developed the following patch that sets the default with the double quotes around it, and it works fine. The patch also contains updated documentation. I just never realized that dollar signs have to be double-quoted, but I it makes sense now that I see it: test=> select lanname as $user from pg_language; ERROR: syntax error at or near "$" at character 19 LINE 1: select lanname as $user from pg_language; ^ test=> select lanname as "$user" from pg_language; $user ---------- internal c sql (3 rows) Are the quotes an improvement? search_path ---------------- "$user",public (1 row) test=> set search_path = "$user",public; SET -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073