Re: [HACKERS] Creating temp tables inside read only transactions

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: [HACKERS] Creating temp tables inside read only transactions
Date: 2011-07-09 07:38:45
Message-ID: 4E180585.6060002@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On 9/07/2011 2:39 PM, Darren Duncan wrote:
> What if you used the context of the calling code and resolve in favor of
> whatever match is closest to it?

*BAD* idea IMHO.

It sounds attractive at first, but inevitably leads to problems where a
query used to work until someone creates a table/type/whatever that's
"closer" and suddenly things explode.

The existing search_path feature already suffers from issues like that,
and it's usually better to explicitly fully qualify names when you're
not just writing interactive code. The same potential foot-gun can be
exploited as an excellent and useful feature when you actually *want*
the same name to point to different things in different contexts, but in
general use it's more likely to create situations where change A breaks
unrelated query B.

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088 Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-07-09 07:42:25 Re: New feature: cached foreign keys
Previous Message Craig Ringer 2011-07-09 07:34:58 Re: [HACKERS] Creating temp tables inside read only transactions

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2011-07-09 08:36:29 Re: [v9.2] Fix leaky-view problem, part 1
Previous Message Craig Ringer 2011-07-09 07:34:58 Re: [HACKERS] Creating temp tables inside read only transactions