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 1fVr0l-0007OI-4Y for pgsql-general@arkaria.postgresql.org; Thu, 21 Jun 2018 04:15:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fVr0j-000209-4F for pgsql-general@arkaria.postgresql.org; Thu, 21 Jun 2018 04:15:53 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fVr0i-000202-HH for pgsql-general@lists.postgresql.org; Thu, 21 Jun 2018 04:15:52 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fVr0f-0003Za-Ey for pgsql-general@postgresql.org; Thu, 21 Jun 2018 04:15:51 +0000 Received: by mail-wm0-x242.google.com with SMTP id p126-v6so2751442wmb.2 for ; Wed, 20 Jun 2018 21:15:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=hmNt0hdQ1mz8jgHe+XVPf7IY2Ze0kiacdDcZVfxNqLY=; b=WNwyuj9OYB+wnRCF5xEcrXnh4OoyQFa9BCiy2MOzZWLfOymec0UhruFaDsqIgT35L9 4MdHjdfDvUJajcI6JKUivi4rH9guk4rfNDc6a9fPV+VMD2Zfsu8SAHrt3+sqOGo/sbD1 CDXGHJSNjh723CnEW+WvsTwe3RTCMzbtgVRbNZnYQc3lBJ/pm6YgKt9xSFCQoXUQHMYs OFMPrI964eNWf/bWT5rR5tVFGbr2bqQRAeQAt5iFMNSTOIAzr0SPMxFiHV7bf5uTQx9K xPTXkbamnXLUL9t7cUcWX41z/C0iiwuyjZzom0eCrUitlpG+ebvKqsRLAHfQimWqMay6 LXkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=hmNt0hdQ1mz8jgHe+XVPf7IY2Ze0kiacdDcZVfxNqLY=; b=FvA2jiWDVyzYC33vQp8BlYbKOlngvdtxDcGI2uWYd5DnyDx5GIrnpJjMkd99TrqgVF y8avlXTUX/8kP6fMYpHkokUzyjll90PFTfxVOlY17AFqBA8Wb/qjzNkoAQgK/YpvXJYN 4UEgXZvRB8QT0uGJalr/nIwPLQwVD4wHb8ZId+LKSSLcEhdB6h851h7EtT1Uu5nEEHAX KlFOrXckZGpdr7wBAUV91lakCYDdzMDtXPAs1cRmnMseV1omCo+c2RHTK2pK8YsVlBWm D//iKfVob6T9L/KUhlmSqvIzK0AMWDHrzFlA8dz3VLoLY8C/CFUF/dtIcHtiWIpmSp1s nZsw== X-Gm-Message-State: APt69E3FYN+MPtMZDc+qOfHYs8j7BCks6OqREV1bl2PL1T0l60yZFtAy rn1s5RhNxPimDmjH8bV23e/NT19LujfP6pb6E0M= X-Google-Smtp-Source: ADUXVKKh5nAO8js81oOVcAMHnclVooVRcN+J02M739eDoa8Ygg/cG6Wgty9VW+RovkkvWVexLEKWowYiwAxsXs2uXcA= X-Received: by 2002:a1c:da4e:: with SMTP id r75-v6mr3570469wmg.64.1529554546500; Wed, 20 Jun 2018 21:15:46 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:96e7:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 21:15:46 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?=C5=81ukasz_Jarych?= Date: Thu, 21 Jun 2018 06:15:46 +0200 Message-ID: Subject: Re: Using DSN Connection and knowing windows username To: Adrian Klaver Cc: "David G. Johnston" , "pgsql-general@postgresql.org >> PG-General Mailing List" Content-Type: multipart/alternative; boundary="00000000000068aa4c056f1f2b8b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000068aa4c056f1f2b8b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you Adrian, 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? Brilliant ! simple and genious! The purpose of it is to have history log table with DML and DDL changes using triggers. Best, Luke 2018-06-21 0:11 GMT+02:00 Adrian Klaver : > On 06/20/2018 07:06 AM, =C5=81ukasz 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, =C5=81ukasz 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 > --00000000000068aa4c056f1f2b8b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thank you Adrian,

In the meantime just a= n idea, but could you capture the system user in a table in Access and use = that to pass on to Postgres?

Brillia= nt ! simple and genious!

The purpose of it is to h= ave history log table with DML and DDL changes using triggers.=C2=A0
<= div>
Best,
Luke


=


2018-06-21 0:11 GMT+02:00 Adrian Klaver <adrian.klaver@a= klaver.com>:
On 06/20/2018 07:06 AM, =C5=81ukasz 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 thi= s as postgresql user?

Only if the system user is a postgres user or can be mapped to one:

https://www.postgresql.org/doc= s/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 ta= ble in Access and use that to pass on to Postgres?



Best ,
Luke

2018-06-20 15:34 GMT+02:00 David G. Johnston <david.g.johnston@gmail.com <ma= ilto:david.= g.johnston@gmail.com>>:

=C2=A0 =C2=A0 On Wednesday, June 20, 2018, =C5=81ukasz Jarych <jaryszek@gmail.com
=
=C2=A0 =C2=A0 <mailto:jaryszek@gmail.com>> wrote:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 How to know in postgresql which specific window= s user is using
=C2=A0 =C2=A0 =C2=A0 =C2=A0 database?

=C2=A0 =C2=A0 You cannot.=C2=A0 All the server knows is the specific user c= redentials
=C2=A0 =C2=A0 it is authenticating.

=C2=A0 =C2=A0 That said you can authenticate those credentials in such a wa= y so
=C2=A0 =C2=A0 that knowing the signed on user you would also know who they = are in
=C2=A0 =C2=A0 any environment that uses the same authentication source - an= d if
=C2=A0 =C2=A0 that source supplies their Windows identity you are golden. T= he
=C2=A0 =C2=A0 specific setups involved here are outside my experience, thou= gh.

=C2=A0 =C2=A0 David J.




--
Adrian Klaver
adrian.klave= r@aklaver.com

--00000000000068aa4c056f1f2b8b--