Re: views, queries, and locks - Mailing list pgsql-general

From Jon Nelson
Subject Re: views, queries, and locks
Date
Msg-id CAKuK5J19L-4TEyFPdemwOhDD9dS2Ls2mJzQx+111n-iNtVxU6Q@mail.gmail.com
Whole thread Raw
In response to Re: views, queries, and locks  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: views, queries, and locks
List pgsql-general
On Wed, Apr 4, 2012 at 9:01 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Why aren't you using a standard partitioned table, cf
> http://www.postgresql.org/docs/9.1/static/ddl-partitioning.html

Because I'm adding "scalar" (constant-value) columns to the view like this:
SELECT * from tableA, DATE 'date string here' as date_column
UNION ALL
SELECT * from tableB, DATE 'date string here' as date_column

for hundreds or even thousands of tables.

> The stuff associated with table inheritance is actually designed for the
> use-case of adding and dropping child tables, and we might consider any
> problems therein as something to be fixed.  Whereas the fact that
> changing a view locks it is unlikely to change.

I'm not asking for "don't lock views when changing them" I'm asking
"does the lock on the view still have to be held after the query
rewrite takes place" (since views are little more than rules?).




--
Jon

pgsql-general by date:

Previous
From: Vincas Dargis
Date:
Subject:
Next
From: Tom Lane
Date:
Subject: Re: