Re: Restrict number of connections to specific table

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Restrict number of connections to specific table
Дата
Msg-id lksvn0$khv$1@ger.gmane.org
обсуждение исходный текст
Ответ на Restrict number of connections to specific table  ("Sam Franklin" <Sam.Franklin@senergyworld.com>)
Ответы Re: Restrict number of connections to specific table
Список pgsql-novice
Sam Franklin, 13.05.2014 12:50:
> Hi – apologies if this question has a painfully obvious answer.  I
> put the N in novice regarding postgresql.
>
> I use postgres with the spatial extension, postgis.
>
> I have some licenced geospatial data. The licence terms state that
> only “one user can access the data at one time”.
>
> I want to add this data to the collection of spatially-enabled
> postgis tables that I serve to my enterprise, where users access and
> consume postgis data tables via GIS clients.
>
>
> Can I put a constraint on a specific table to restrict the number of
> concurrent connections to 1, which will allow me to adhere to the
> data licencing terms?
>
> If not, is there an alternative solution to serve up the data via a
> PostgreSQL table and still keep within the data licence terms?

There is no configuration option if you mean that.

One thing I can think of is to allow access to that table only through a function. Inside that function lock the table
exclusivelyso that no other session can access it.  

The question then is: _when_ do you release this lock?

If you release the lock after the select has finished, two users could query the data one after the other. But if the
firstuser doesn't clear the results within the tool that is used to display the data you would still wind up with two
users"accessing" the data at the same time. 

Thomas


В списке pgsql-novice по дате отправления:

Предыдущее
От: "Sam Franklin"
Дата:
Сообщение: Restrict number of connections to specific table
Следующее
От: Keith
Дата:
Сообщение: Re: Restrict number of connections to specific table