From 9d9aed433bd29eefb14807c02050cb8b88f15f0e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 21 Oct 2010 11:26:16 -0700 Subject: add a session authorization setter to the pg connection --- .../lib/active_record/connection_adapters/postgresql_adapter.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activerecord/lib/active_record/connection_adapters') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 64a07cccca..e785cc6fea 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -389,6 +389,11 @@ module ActiveRecord end end + # Set the authorized user for this session + def session_auth=(user) + exec "SET SESSION AUTHORIZATION #{user}" + end + # REFERENTIAL INTEGRITY ==================================== def supports_disable_referential_integrity?() #:nodoc: -- cgit v1.2.3