Обсуждение: How Restricting user

Поиск
Список
Период
Сортировка

How Restricting user

От
Daniel Gallo
Дата:
Dear , I would like to make a query , I plan to create a user in my database , but only to make inquires , I would also like to have limits such as connection time, idle time , logical reads , is this possible? 
Thank you very much for your time

Re: How Restricting user

От
"David G. Johnston"
Дата:
​Some yes, some no.  Read up on GRANT.  Most of the resource stuff cannot be accomplished within PostgreSQL.  No clue what you mean by "logical reads".

Dave

On Thu, Feb 25, 2016 at 5:08 AM, Daniel Gallo <danielito.gallo@gmail.com> wrote:
Dear , I would like to make a query , I plan to create a user in my database , but only to make inquires , I would also like to have limits such as connection time, idle time , logical reads , is this possible? 
Thank you very much for your time

Re: How Restricting user

От
Adrian Klaver
Дата:
On 02/25/2016 07:50 AM, David G. Johnston wrote:
> ​Some yes, some no.  Read up on GRANT.  Most of the resource stuff
> cannot be accomplished within PostgreSQL.  No clue what you mean by
> "logical reads".

 From what I gather a logical read is one that pulls from cache versus
off the disk:


https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4b912b12-a8da-4241-9db1-57f7ed7130d2/logical-read?forum=sqldatabaseengine


>
> Dave
> ​
>
> On Thu, Feb 25, 2016 at 5:08 AM, Daniel Gallo <danielito.gallo@gmail.com
> <mailto:danielito.gallo@gmail.com>> wrote:
>
>     Dear , I would like to make a query , I plan to create a user in my
>     database , but only to make inquires , I would also like to have
>     limits such as connection time, idle time , logical reads , is this
>     possible?
>     Thank you very much for your time
>
>


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: How Restricting user

От
dangal
Дата:
In Oracle i have something  like this:

-- Create profile
create profile PROFILE_Query limit
  sessions_per_user 25
  cpu_per_call 30000
  connect_time 120
  idle_time 20
  logical_reads_per_session 80000
  logical_reads_per_call 25000;

-- Add users to profile
alter user XXX profile PROFILE_Query ;

I cant find something like this in postgres



--
View this message in context: http://postgresql.nabble.com/How-Restricting-user-tp5889240p5889292.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


Re: How Restricting user

От
"David G. Johnston"
Дата:
On Thu, Feb 25, 2016 at 11:01 AM, dangal <danielito.gallo@gmail.com> wrote:
In Oracle i have something  like this:

-- Create profile
create profile PROFILE_Query limit
  sessions_per_user 25
  cpu_per_call 30000
  connect_time 120
  idle_time 20
  logical_reads_per_session 80000
  logical_reads_per_call 25000;

-- Add users to profile
alter user XXX profile PROFILE_Query ;

I cant find something like this in postgres

​It doesn't exist in PostgreSQL.

David J.
 

Re: How Restricting user

От
Daniel Gallo
Дата:
thanks a lot David!!!!

2016-02-25 15:08 GMT-03:00 David G. Johnston <david.g.johnston@gmail.com>:
On Thu, Feb 25, 2016 at 11:01 AM, dangal <danielito.gallo@gmail.com> wrote:
In Oracle i have something  like this:

-- Create profile
create profile PROFILE_Query limit
  sessions_per_user 25
  cpu_per_call 30000
  connect_time 120
  idle_time 20
  logical_reads_per_session 80000
  logical_reads_per_call 25000;

-- Add users to profile
alter user XXX profile PROFILE_Query ;

I cant find something like this in postgres

​It doesn't exist in PostgreSQL.

David J.
 

Re: How Restricting user

От
"Joshua D. Drake"
Дата:
On 02/25/2016 10:09 AM, Daniel Gallo wrote:
> thanks a lot David!!!!

It wouldn't be hard to create a limiting system in user space however.
It would be a little obnoxious but it can be done. For example
connect_time and idle_time are relatively easy to implement with a
proper session handler in user space. You could also invalidate user
accounts by using the valuntil flag in pg_user.

It would be harder to do things like cpu_per_call (the database isn't
really the place for that) as well as logical reads.

Sincerely,

JD

--
Command Prompt, Inc.                  http://the.postgres.company/
                         +1-503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Everyone appreciates your honesty, until you are honest with them.


Re: How Restricting user

От
dangal
Дата:
Joshua thank you very much , my knowledge does not allow me to do what you
explained to me !!
Something can be interesting for inclusion in future versions



--
View this message in context: http://postgresql.nabble.com/How-Restricting-user-tp5889240p5889298.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.