Re: views, queries, and locks

From: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: views, queries, and locks
Date: 2012-04-04 15:14:58
Message-ID: CAKuK5J19L-4TEyFPdemwOhDD9dS2Ls2mJzQx+111n-iNtVxU6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 4, 2012 at 9:01 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2012-04-04 15:18:26 Re: Fwd: [GENERAL] 9.1.3: launching streaming replication
Previous Message Vincas Dargis 2012-04-04 14:30:07