Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVlKW-00020S-Fl for pgsql-general@arkaria.postgresql.org; Wed, 20 Jun 2018 22:11:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVlKU-0001Hk-T7 for pgsql-general@arkaria.postgresql.org; Wed, 20 Jun 2018 22:11:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVlKS-0001Hd-JS for pgsql-general@lists.postgresql.org; Wed, 20 Jun 2018 22:11:54 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVlKN-0004md-Vr for pgsql-general@postgresql.org; Wed, 20 Jun 2018 22:11:52 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D1E2A21A81; Wed, 20 Jun 2018 18:11:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 20 Jun 2018 18:11:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=7Oj9naQPQ11PtTnV8mMy0mfbdSSxc brCXcXKN8cmo9Y=; b=H9zCjoWXfnXwvXNM0k7p5UIRUogrheZEisnqf0P2YODrS 7zvn+lv3prIWEwwcwmDJQm4LE/O21j6QCMwiZ2MlQNXAZ74OILRbyhsrH2SFGpF3 QATOaNvNsgDLhCfWPRh/Nc7ygtN8k4iU0ZKTucbo4V0en1bbinoCxUK+t3mzMEcr iI5zWK1rE8tA+z5Cjbi+ACcYA5PSLLdMgwtkY7Hk9SVVZ6xC4+U4Hi6JTv71uA9I tkgNaru66vI0D+ifcGBYBYoKLxhYi8BEZehzCqaUr0PATBqX4CbBkifg9sL4xK5M BtpkJxbKNDGM9t2l/IzEOoL75vIfKptv2kgzGM33g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=7Oj9na QPQ11PtTnV8mMy0mfbdSSxcbrCXcXKN8cmo9Y=; b=nY6AxzIKNkN1CJBVqR7/i/ hcW42vxJa5/WmY5bhPkdHh0/F3msy73XjND/kyGx0tGdKqis9pVkuu8MNZJA2BJj QYTzREs81UoX6F9T/UEVZ2D0qJGWwwFrFHQ3iPli9jUmjGt0mZIBxCmKG4z7nj/e CmHfDdkZWSFlf6Qsy2YMt9RIXm4h6VxonJRjseQ10jBgUynqINyKx7Yn/W+6h/C8 rXyx29EElPiQtu+yEHapAKt5Oacfc8LLbjlS7wJxT6xbCj3xjn4yj3Bd2QK0IUkL TfgxuVN/+D3jm1MqCfgnvlpO6aqo46+wto6WdDYaIBbHV2RfcqIgtzecv6IFpZqA == X-ME-Proxy: X-ME-Sender: Received: from ranger.suse (50-197-80-2-static.hfc.comcastbusiness.net [50.197.80.2]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FCF8E46C2; Wed, 20 Jun 2018 18:11:43 -0400 (EDT) Subject: Re: Using DSN Connection and knowing windows username To: =?UTF-8?Q?=c5=81ukasz_Jarych?= , "David G. Johnston" Cc: "pgsql-general@postgresql.org >> PG-General Mailing List" References: From: Adrian Klaver Message-ID: Date: Wed, 20 Jun 2018 15:11:43 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 06/20/2018 07:06 AM, Łukasz Jarych wrote: > David G, > > thank you. > Can you confirm if i am thinking correctly ? > > So I can set up authetification to know which user is logged on and use > this as postgresql user? Only if the system user is a postgres user or can be mapped to one: https://www.postgresql.org/docs/10/static/auth-username-maps.html > > But i think it will be not possible to use DSN connection with this. If you are talking about the ODBC DSN you use to create the linked table in Access then you are correct you are limited to whatever user is specified in the ODBC Manager. It would help to know what you plan to use the user name for? In the meantime just an idea, but could you capture the system user in a table in Access and use that to pass on to Postgres? > > Best , > Luke > > 2018-06-20 15:34 GMT+02:00 David G. Johnston >: > > On Wednesday, June 20, 2018, Łukasz Jarych > wrote: > > How to know in postgresql which specific windows user is using > database? > > > You cannot.  All the server knows is the specific user credentials > it is authenticating. > > That said you can authenticate those credentials in such a way so > that knowing the signed on user you would also know who they are in > any environment that uses the same authentication source - and if > that source supplies their Windows identity you are golden. The > specific setups involved here are outside my experience, though. > > David J. > > -- Adrian Klaver adrian.klaver@aklaver.com