Another conversion from ASA to PostGres how to

Started by Mike Gouldalmost 19 years ago3 messagesgeneral
Jump to latest
#1Mike Gould
mgould@allcoast.net

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

#2Francisco Reyes
lists@stringsutils.com
In reply to: Mike Gould (#1)
Re: Another conversion from ASA to PostGres how to

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 }

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Francisco Reyes (#2)
Re: Another conversion from ASA to PostGres how to

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