Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqVmC-00CojO-7t for pgsql-odbc@arkaria.postgresql.org; Sat, 30 Mar 2024 10:17:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rqVmB-007oe1-B0 for pgsql-odbc@arkaria.postgresql.org; Sat, 30 Mar 2024 10:17:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqVmA-007ods-Ri for pgsql-odbc@lists.postgresql.org; Sat, 30 Mar 2024 10:17:27 +0000 Received: from mx08-00574e01.pphosted.com ([185.183.31.38]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rqVm4-007EzD-C6 for pgsql-odbc@postgresql.org; Sat, 30 Mar 2024 10:17:24 +0000 Received: from pps.filterd (m0213999.ppops.net [127.0.0.1]) by mx08-00574e01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 42U9kvYK032730 for ; Sat, 30 Mar 2024 10:17:19 GMT Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by mx08-00574e01.pphosted.com (PPS) with ESMTPS id 3x681r89c5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sat, 30 Mar 2024 10:17:18 +0000 (GMT) Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a46ba1a19fdso186373866b.1 for ; Sat, 30 Mar 2024 03:17:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711793838; x=1712398638; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=r+5LnfrHnoy1d41Q+GIpyXbSnuTFZLFL7TJqfhob8C4=; b=cH0xEZSe4AI+zlLis4l6izsnwwFBVg9uo1ble0pnkbq6YO9d6un/eVMdMyURP4WoQN inAnpoo7z4q0DKYl3BPKZuDPVG3SIGFWArbJ0wZCZR1yvccWdzp8bT9Vv6M0FJ+LxpuX /3xm6JVzjTqkM8GSxCz6yKeok2N2JAgCk2OnPkzGFpydI+MnDO1tI+FzQ8Ud2oW1aW/U JCy4gcUTylVFfMuympKefsgojgLBdmiRx2f9ETRW1FhCRbFn4frnNta3jtN0OJfHirBD 2NZnfzBcykPdBNxAgc9bJ5gKGajvQxKLLWaPds3PZ9Sxw5cKpnha4cp71PFU5viNUl5J sAag== X-Forwarded-Encrypted: i=1; AJvYcCUVgQmF9UYUHgtMPit3kV9BBGktwiLa8AySlJ5JJTAaDTLzvAO0oWJ9XyFqmZa4/I6+Mii7niBdTLN3Y7EVEmiEP2sQJUClOYpO X-Gm-Message-State: AOJu0Yw2pFTFAbhd2rs5+/jZtvKnI0sFNIPtS9dJjpBA+cEuoD/12FYW OVoOe3Cs2SRtKvFP2bbH+tRgCTJbhKmu9WicQAEeuJkVzarKVHL0xCm0akOHOMBdWzMGQBp8zpZ DCLae/ABxqcbI16pifNu6Nq8GaCtqj/nz/FDdPTvW295S9DOYNr/BvL1D/Jz6Jo9xR5DNP5Bh7U sENkZjQPFsKX+deX+IuMHkSITJ81wrESYfcK5p X-Received: by 2002:a17:906:7006:b0:a4e:1b02:81d7 with SMTP id n6-20020a170906700600b00a4e1b0281d7mr2703966ejj.16.1711793838288; Sat, 30 Mar 2024 03:17:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRN4J3RMfIvKQ8zu7w80OXEEs9LYoQyWYBF14QRP8DR4AV//T2STHrvUFCBltpxag3RqfFqcEv2AsW X-Received: by 2002:a17:906:7006:b0:a4e:1b02:81d7 with SMTP id n6-20020a170906700600b00a4e1b0281d7mr2703952ejj.16.1711793837747; Sat, 30 Mar 2024 03:17:17 -0700 (PDT) Received: from eu2gs2.smtp.exclaimer.net (eu2gs2.smtp.exclaimer.net. [40.127.253.49]) by smtp-relay.gmail.com with ESMTPS id dp3-20020a170906c14300b00a4e0cdc0e28sm137217ejc.53.2024.03.30.03.17.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2024 03:17:17 -0700 (PDT) X-Relaying-Domain: iress.com Received: from mail-ej1-f69.google.com (209.85.218.69) by eu2gs2.smtp.exclaimer.net (40.127.253.49) with Exclaimer Signature Manager ESMTP Proxy eu2gs2.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_ECDHE_WITH_AES256_SHA1); Sat, 30 Mar 2024 10:17:17 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 5502713 X-ExclaimerImprintLatency: 2862342 X-ExclaimerImprintAction: 198e7181344b4180afb4f0faf4238931 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a467a6d4e3eso116283866b.3 for ; Sat, 30 Mar 2024 03:17:17 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUnSg1lZE5mQURIYiTGodVMdZbP/oSU76/F+g1Man/6gDdCzpqOObn6AlBScf2P44rOg2W56Bl8qdtuAu3FgcSTtcv725PHT/1u X-Received: by 2002:a17:906:7245:b0:a4e:2269:bc21 with SMTP id n5-20020a170906724500b00a4e2269bc21mr2909748ejk.1.1711793836275; Sat, 30 Mar 2024 03:17:16 -0700 (PDT) X-Received: by 2002:a17:906:7245:b0:a4e:2269:bc21 with SMTP id n5-20020a170906724500b00a4e2269bc21mr2909740ejk.1.1711793835904; Sat, 30 Mar 2024 03:17:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adrian Grucza Date: Sat, 30 Mar 2024 21:17:04 +1100 Message-ID: Subject: Re: How to create an ODBC datasource in CI To: Dave Cramer Cc: Jon Raiford , PostgreSQL mailing lists Content-Type: multipart/alternative; boundary="00000000000084a93b0614de0fc2" X-Proofpoint-GUID: j5AxPzcLQa3bNpwQz28LGKNFIJUVKYv2 X-Proofpoint-ORIG-GUID: j5AxPzcLQa3bNpwQz28LGKNFIJUVKYv2 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --00000000000084a93b0614de0fc2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable If your aim is to run the regression tests then winbuild/regress.ps1 does everything for you: installs a dev version of the driver, creates a DSN for it and runs the tests against a PostgreSQL server (which you could run in Docker). But if you want to use the MSI installer, running that will install the driver for you: Start-Process 'C:\\psqlodbc_x64.msi' '/quiet /passive' -PassThru | Wait-Process; You then just need to create the DSN: Add-OdbcDsn -Name "MyPostgresDsn" -DsnType 'User' -Platform '64-bit' -DriverName 'PostgreSQL Unicode(x64)' Set-OdbcDsn -Name "MyPostgresDsn" ` -DsnType "User" ` -SetPropertyValue @("Servername=3D${env:DB_HOST}" ` ,'Port=3D5432' ` ,"SSLMode=3D${env:SSL_MODE}" ` ,'BoolsAsChar=3D0' ` ,'FetchRefcursors=3D1' ` ,'MaxVarcharSize=3D4094' ` ) Adrian Grucza Technical Lead Office: +61390185800 The contents of this email originated from Iress. For this purpose Iress in= cludes Iress Limited and/or any of its subsidiaries, holding companies and = trading entities. =E2=80=8B=E2=80=8BIf you have received this email in error please notify th= e sender immediately and delete this email. On Sat, 30 Mar 2024 at 6:53=E2=80=AFpm, Dave Cramer = wrote: > > > *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this > sender before clicking on any links or attachments. > > > > > On Fri, 29 Mar 2024 at 18:49, Adrian Grucza > wrote: > >> winbuild/regress.ps1 uses RegisterRegdsn.exe (built from >> test/RegisterRegdsn.c) to install the driver and register a data source. >> You could use that, or you may find it easier to use the Wdac cmdlets >> in >> PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn. >> >> > Yes, I saw those, was going to try them. I think the challenge is > registering the driver first though. > > Dave > >> >> [image: iress.com] >> Adrian Grucza >> Technical Lead >> Office: +61390185800 >> adrian.grucza@iress.com >> www.iress.com >> Level 16 385 Bourke St >> >> Melbourne >> >> , Victoria, 3000 >> The contents of this email originated from Iress. For this purpose Iress >> includes Iress Limited and/or any of its subsidiaries, holding companies >> and trading entities. If you have received this email in error please >> notify the sender immediately and delete this email. >> nosig >> > On Sat, 30 Mar 2024 at 2:12=E2=80=AFam, Dave Cramer wrote: >> >>> >>> >>> *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this >>> sender before clicking on any links or attachments. >>> >>> >>> >>> >>> On Fri, 29 Mar 2024 at 08:41, Jon Raiford wrote: >>> >>>> I=E2=80=99m not familiar with GitHub Actions, but I know you can creat= e data >>>> sources from the command line. This is all stored in the registry, whi= ch >>>> you can update using the reg command. >>>> >>>> >>>> >>>> >>>> https://learn.microsoft.com/en-us/windows-server/administration/window= s-commands/reg >>>> >>>> >>>> >>>> >>>> The easiest thing to do may be to create a data source manually and >>>> export it into a .reg file. You can then either import the data source >>>> using the reg file or just use it as a template to add the entries as = you >>>> like. >>>> >>>> >>>> Just run Regedit and locate the data source you would like to export. >>>> >>>> >>>> >>>> 64-bit System Data Sources: \\HKLM\SOFTWARE\ODBC\ >>>> >>>> >>>> 32-bit System Data Sources: \\HKLM\SOFTWARE\WOW6432Node\ODBC\ >>>> >>>> >>>> 64-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\ >>>> >>>> 32-bit User Data Sources: \\HKCU\SOFTWARE\ODBC\ >>>> >>>> <- This is mixed in with the 64-bit entries and the driver referenced >>>> determines if 32/64 >>>> >>>> >>>> >>>> Drivers are defined under the system keys under the section >>>> ODBCINST.INI. Data sources are defined under the section ODBC.INI, bot= h as >>>> a folder containing the details of the data source as well as an entry >>>> under =E2=80=9CODBC.INI\ODBC Data Sources=E2=80=9D, which associates t= he data source with >>>> the driver to use with it. >>>> >>>> >>>> >>>> I think if you view these entries in Regedit you will see the >>>> relationships between everything. It may help to create a data source = for >>>> each type. >>>> >>>> >>>> >>>> The above describes how to create a static ODBC data source. >>>> Alternatively you can use a file DSN or simply make a connection strin= g >>>> from your test case and avoid the data source completely. Although I >>>> suppose you may want to do each in order to test each possibility. >>>> >>>> >>>> >>>> Let me know if you have any questions or need assistance. >>>> >>>> >>>> >>>> Jon >>>> >>> >>> Hey Jon, >>> >>> Thanks, that will help immensely. >>> >>> It's been a while since I've done anything with Windows. >>> >>> Dave >>> >>>> >>>> >>>> >>>> >>>> *From: *Dave Cramer >>>> *Date: *Friday, March 29, 2024 at 7:25=E2=80=AFAM >>>> *To: *PostgreSQL mailing lists >>>> *Subject: *How to create an ODBC datasource in CI >>>> >>>> Greetings, >>>> >>>> >>>> >>>> In order to test the driver using github actions we need to be able to >>>> create a windows datasource. Usually this requires some kind of user >>>> interaction. >>>> >>>> >>>> >>>> Has anyone done this on GH actions ? >>>> >>>> >>>> >>>> >>>> Dave Cramer >>>> >>> --00000000000084a93b0614de0fc2 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
If your aim is to run the regres= sion tests then winbuild/regress.ps1 does everything for you: installs a de= v version of the driver, creates a DSN for it and runs the tests against a = PostgreSQL server (which you could run in Docker).
<= br>
But if you want to use the MSI installer, runnin= g that will install the driver for you:

Start-Process 'C:\\psqlodbc_x64.msi&#= 39; '/quiet /passive' -PassThru | Wait-Process;

You then just need to create the DSN:

Add-OdbcDsn -Name "MyPostgresDsn" -= DsnType 'User' -Platform '64-bit' -DriverName 'PostgreS= QL Unicode(x64)'

Set-OdbcDsn -Name "MyPo= stgresDsn" `
=C2=A0-DsnType "User&q= uot; `
=C2=A0-SetPropertyValue @("Servername= =3D${env:DB_HOST}" `
=C2=A0,'Port=3D5432= 9; `
=C2=A0,"SSLMode=3D${env:SSL_MODE}" `<= /div>
=C2=A0,'BoolsAsChar=3D0' `
=C2=A0,'FetchRefcursors=3D1' `
=C2=A0,= 'MaxVarcharSize=3D4094' `
=C2=A0)

<= /div>

<= /tr>
3D""
Adrian Grucza<= span style=3D"font-family:'zone-1';">​
Technical Lead
Office: +61390185800
=
The contents of this email originated from = Iress. For this purpose Iress includes Iress Limited and/or any of its subs= idiaries, holding companies and trading entities.
​​If you= have received this email in error please notify the sender immediately and= delete this email. 

<= /td>
On Sat, 30 Mar 2024 a= t 6:53=E2=80=AFpm, Dave Cramer <= davecramer@gmail.com> wrote:

<= td>

CAUTION: This Email is from an EXTERNAL source. Ensu= re you trust this sender before clicking on any links or attachments.




On Fri, 29 Mar 2024 at 18:49, A= drian Grucza <adrian.grucza@iress.com> wrote:
winbuild/regress.ps1 uses RegisterRegdsn.exe (built from te= st/RegisterRegdsn.c) to install the driver and register a data source. You = could use that, or you may find it easier to use the Wdac c= mdlets=C2=A0in PowerShell, specifically Add-OdbcDsn and Set-OdbcDsn.


Yes, = I saw those, was going to try them. I think the challenge is registering th= e driver first though.

Dave=C2=A0

3D"iress.com"
Adrian=C2=A0Grucza=C2=A0=C2=A0
Technical=C2=A0Lead
Office:=C2=A0<= a href=3D"tel:+61390185800" id=3D"m_-4775597996432796148m_20889078018145116= 0LPlnk689713" style=3D"text-decoration:none;font-family:Arial;color:rgb(153= ,153,153)" target=3D"_blank">+61390185800
<= td align=3D"left" style=3D"vertical-align:top;font-family:Arial">adrian.grucza@iress.com<= /tbody>
www.iress.com
Level=C2=A016=C2=A0385=C2=A0Bou= rke=C2=A0St
=C2=A0Melbourne,=C2=A0Victoria,=C2=A03000
=
= The con= tents of this email originated from Iress. For this purpose Iress includes = Iress Limited and/or any of its subsidiaries, holding companies and trading= entities. If you have received this email in error please notify the sende= r immediately and delete this email.=C2=A0
nosig
On Sat, 30 Mar 2024 at 2:12=E2=80=AFam, Dave = Cramer <davecr= amer@gmail.com> wrote:

<= td>

CAUTION: This Email is from an EXTERNAL source. Ensu= re you trust this sender before clicking on any links or attachments.




On Fri, 29 Mar 2024 at 08:41, J= on Raiford <rai= ford@labware.com> wrote:

I=E2=80=99m not famil= iar with GitHub Actions, but I know you can create data sources from the co= mmand line. This is all stored in the registry, which you can update using = the reg command.

=C2=A0<= /span>

https:= //learn.microsoft.com/en-us/windows-server/administration/windows-commands/= reg

=C2=A0<= /span>

The easiest thing to = do may be to create a data source manually and export it into a .reg file. = You can then either import the data source using the reg file or just use i= t as a template to add the entries as you like.


Just run Regedit and locate the data source you would like to export.

=C2=A0<= /span>

64-bit System Data So= urces: \\HKLM\SOFTWARE\ODBC\

32-bit System Data So= urces: \\HKLM\SOFTWARE\WOW6432Node\ODBC\

64-bit User Data Sour= ces: \\HKCU\SOFTWARE\ODBC\

32-bit User Data Sour= ces: \\HKCU\SOFTWARE\ODBC\=C2=A0=C2=A0=C2=A0=C2=A0 <- This is mixed in wi= th the 64-bit entries and the driver referenced determines if 32/64<= u>

=C2=A0<= /span>

Drivers are defined u= nder the system keys under the section ODBCINST.INI. Data sources are defin= ed under the section ODBC.INI, both as a folder containing the details of t= he data source as well as an entry under =E2=80=9CODBC.INI\ODBC Data Sources=E2=80=9D, which associates the d= ata source with the driver to use with it.

=C2=A0<= /span>

I think if you view t= hese entries in Regedit you will see the relationships between everything. = It may help to create a data source for each type.

= =0D=0A

=C2=A0

The above describes h= ow to create a static ODBC data source. Alternatively you can use a file DS= N or simply make a connection string from your test case and avoid the data= source completely. Although I suppose you may want to do each in order to test each possibility.

=C2=A0<= /span>

Let me know if you ha= ve any questions or need assistance.

=C2=A0<= /span>

Jon

<= /div>

Hey Jon,

Thanks, that will help immensely.

It's been= a while since I've done anything with Windows.

Dave=C2=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rg= b(204,204,204)">

=C2=A0<= /span>

=C2=A0<= /span>

From: Dave Cramer <davecramer@gmail.com>
Date: Friday, March 29, 2024 at 7:25
=E2=80=AFAM
To: PostgreSQL mailing lists <pgsql-odbc@postgresql.org>
Subject: How to create an ODBC datasource in CI
=

Greetings,

=C2=A0

In order to test the driver using github actions we = need to be able to create a windows datasource. Usually this requires some = kind of user interaction.

=C2=A0

Has anyone=C2=A0done this on GH actions ?<= /u>

=C2=A0


Dave Cramer

--00000000000084a93b0614de0fc2--