Thread: Another conversion from ASA to PostGres how to

Another conversion from ASA to PostGres how to

From
"Mike Gould"
Date:
All,

As the subject says we are converting from Sybase's SQL Anywhere to PostGres 8.2.4.  One of the features in ASA is a SET OPTION PUBLIC.login_procedure='DBA.login_check'.

After a user is authenticated on a connection, if this setting is set, then the database automatically triggers this procedure to be run.  We use this to set up a bunch of "global variables" and other settings which need to be updated when a connection is made.  How would I handle this in PostGres?

Best Regards,

Michael Gould
All Coast Intermodal Services, Inc.
904-376-7030

Re: Another conversion from ASA to PostGres how to

From
Francisco Reyes
Date:
Mike Gould writes:

> After a user is authenticated on a connection, if this setting is set,
> then the database automatically triggers this procedure to be run.

Don't know about triggers, but I you can do "set" commands on a per
user bases.



ALTER USER name SET configuration_parameter { TO | = } { value | DEFAULT }

Re: Another conversion from ASA to PostGres how to

From
Tom Lane
Date:
Francisco Reyes <lists@stringsutils.com> writes:
> Mike Gould writes:
>> After a user is authenticated on a connection, if this setting is set,
>> then the database automatically triggers this procedure to be run.

> Don't know about triggers, but I you can do "set" commands on a per
> user bases.

psql's startup file (~/.psqlrc) is another place where you can put
startup commands, though of course that only works for psql sessions.
Not sure if there are equivalent features in pgAdmin or other clients.

            regards, tom lane