Обсуждение: Feature-Request: Login-Procedure

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

Feature-Request: Login-Procedure

От
"A. Kretschmer"
Дата:
Hello,

Someone asks for a Login-Procedure like Sybase:

  set OPTION PUBLIC.LOGIN_PROCEDURE='meine_tolle_prozedur';

I think, this i possibly a nice feature, either per user or for all
users. We have a 'ALTER USER name SET parameter ...', simply add a new
Parameter 'login_procedure' and call this procedure?


Any comments?


Regards, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

Re: Feature-Request: Login-Procedure

От
Tino Wildenhain
Дата:
A. Kretschmer schrieb:
> Hello,
>
> Someone asks for a Login-Procedure like Sybase:
>
>   set OPTION PUBLIC.LOGIN_PROCEDURE='meine_tolle_prozedur';
>
> I think, this i possibly a nice feature, either per user or for all
> users. We have a 'ALTER USER name SET parameter ...', simply add a new
> Parameter 'login_procedure' and call this procedure?
>
I wonder what this procedure should do? :-)

Regards
Tino

Re: Feature-Request: Login-Procedure

От
"A. Kretschmer"
Дата:
am  11.05.2006, um 11:56:51 +0200 mailte Tino Wildenhain folgendes:
> A. Kretschmer schrieb:
> >Hello,
> >Someone asks for a Login-Procedure like Sybase:
> >  set OPTION PUBLIC.LOGIN_PROCEDURE='meine_tolle_prozedur';
> >I think, this i possibly a nice feature, either per user or for all
> >users. We have a 'ALTER USER name SET parameter ...', simply add a new
> >Parameter 'login_procedure' and call this procedure?
> I wonder what this procedure should do? :-)

For instance:

- the database-administrator can set a flag in one table to deny
  user-logins, a syste-wide logon-proc can check this flag.
  See News, MID <4cddr5F14e7vpU1@individual.net>, i know, you can read
  german better than i can write english ;-)

- Accounting

- create a greeting ;-)
  (who has birthday?, ...)

- ...


Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

Re: Feature-Request: Login-Procedure

От
Tino Wildenhain
Дата:
A. Kretschmer schrieb:
> am  11.05.2006, um 11:56:51 +0200 mailte Tino Wildenhain folgendes:
>
>>A. Kretschmer schrieb:
>>
>>>Hello,
>>>Someone asks for a Login-Procedure like Sybase:
>>> set OPTION PUBLIC.LOGIN_PROCEDURE='meine_tolle_prozedur';
>>>I think, this i possibly a nice feature, either per user or for all
>>>users. We have a 'ALTER USER name SET parameter ...', simply add a new
>>>Parameter 'login_procedure' and call this procedure?
>>
>>I wonder what this procedure should do? :-)
>
>
> For instance:
>
> - the database-administrator can set a flag in one table to deny
>   user-logins, a syste-wide logon-proc can check this flag.

say like pg_hba.conf? ;)

>   See News, MID <4cddr5F14e7vpU1@individual.net>, i know, you can read
>   german better than i can write english ;-)
>
> - Accounting

ok, this one maybe ;)

>
> - create a greeting ;-)
>   (who has birthday?, ...)
>
I was not aware so many people working at the psql console
regulary :-)

Re: Feature-Request: Login-Procedure

От
"A. Kretschmer"
Дата:
am  11.05.2006, um 12:30:13 +0200 mailte Tino Wildenhain folgendes:
> >>I wonder what this procedure should do? :-)
> >For instance:
> >- the database-administrator can set a flag in one table to deny
> >  user-logins, a syste-wide logon-proc can check this flag.
>
> say like pg_hba.conf? ;)

Yes, but without reload/restart the server ;-)


>
> >  See News, MID <4cddr5F14e7vpU1@individual.net>, i know, you can read
> >  german better than i can write english ;-)
> >- Accounting
>
> ok, this one maybe ;)
>
> >- create a greeting ;-)
> >  (who has birthday?, ...)
> I was not aware so many people working at the psql console
> regulary :-)

No? I'm amazed ;-) There are other clients?


Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

Re: Feature-Request: Login-Procedure

От
Tino Wildenhain
Дата:
A. Kretschmer schrieb:
> am  11.05.2006, um 12:30:13 +0200 mailte Tino Wildenhain folgendes:
>
>>>>I wonder what this procedure should do? :-)
>>>
>>>For instance:
>>>- the database-administrator can set a flag in one table to deny
>>> user-logins, a syste-wide logon-proc can check this flag.
>>
>>say like pg_hba.conf? ;)
>
>
> Yes, but without reload/restart the server ;-)

Ok, there already is a thread about having pg_hba.conf
in tables... ;) Otoh, reload does not hurt ;)
>
>
>>> See News, MID <4cddr5F14e7vpU1@individual.net>, i know, you can read
>>> german better than i can write english ;-)
>>>- Accounting
>>
>>ok, this one maybe ;)
>>
>>
>>>- create a greeting ;-)
>>> (who has birthday?, ...)
>>
>>I was not aware so many people working at the psql console
>>regulary :-)
>
>
> No? I'm amazed ;-) There are other clients?

I have the impression most people are working via some
kind of other application which is using postgres as
invisible backend :-)

Btw, greating can be done via .psqlrc or so too :-)

Regards
Tino

Re: Feature-Request: Login-Procedure

От
Berend Tober
Дата:
Tino Wildenhain wrote:

> A. Kretschmer schrieb:
>> Someone asks for a Login-Procedure like Sybase:
>>
>>   set OPTION PUBLIC.LOGIN_PROCEDURE='meine_tolle_prozedur';
>>
>> I think, this i possibly a nice feature, either per user or for all
>> users. We have a 'ALTER USER name SET parameter ...', simply add a new
>> Parameter 'login_procedure' and call this procedure?
>>
> I wonder what this procedure should do? :-)

If I had something like this (what I would describe as an "ON CONNECT
TRIGGER"), I'd use it to update a table identifying the last time a user
logged in to the data base. Or maybe even use it to update their
password expiration date to NOW()+30 DAYS, so that the data base
automatically expires accounts that aren't being used.

Regards,
Berend Tober

Вложения

Re: Feature-Request: Login-Procedure

От
Scott Marlowe
Дата:
On Thu, 2006-05-11 at 05:58, Tino Wildenhain wrote:
> A. Kretschmer schrieb:
> > am  11.05.2006, um 12:30:13 +0200 mailte Tino Wildenhain folgendes:
> >
> >>I was not aware so many people working at the psql console
> >>regulary :-)
> >
> >
> > No? I'm amazed ;-) There are other clients?
>
> I have the impression most people are working via some
> kind of other application which is using postgres as
> invisible backend :-)

Where I work it's about 75% or so psql, and about 25% other (various gui
tools)

> Btw, greating can be done via .psqlrc or so too :-)

I see this as a two edged blade.

While there are certainly things neither you nor I have thought of that
a login fired procedure could be useful for, there are also going to be
cases of people "reinventing the wheel" with it, i.e. doing things that
should probably be in pg_hba.conf.

OTOH, only the postgres account holder can edit the pg_hba.conf and
reload the database, while you could easily have a user editable table
referred to by a login proc that did something similar, and have the
permissions set so that a certain class of users (i.e. help desk folks)
could edit the settings for a user.

I think a login proc is more of a plus than a minus...  But I'm not the
guy slinging the code (I've been working 60 hours a week for the last
three months...  I barely have time to monitor the lists and answer
simple questions...)

Re: Feature-Request: Login-Procedure

От
Karsten Hilbert
Дата:
On Thu, May 11, 2006 at 12:30:13PM +0200, Tino Wildenhain wrote:

> >- create a greeting ;-)
> >  (who has birthday?, ...)
> >
> I was not aware so many people working at the psql console
> regulary :-)
Na klar !   :-)

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346