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 1rqX9d-00Cwmq-BC for pgsql-odbc@arkaria.postgresql.org; Sat, 30 Mar 2024 11:45:46 +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 1rqX9c-0087Wb-5u for pgsql-odbc@arkaria.postgresql.org; Sat, 30 Mar 2024 11:45:44 +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 1rqX9b-0087Uq-Hr for pgsql-odbc@lists.postgresql.org; Sat, 30 Mar 2024 11:45:43 +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 1rqX9U-007Fec-Q9 for pgsql-odbc@postgresql.org; Sat, 30 Mar 2024 11:45:41 +0000 Received: from pps.filterd (m0213998.ppops.net [127.0.0.1]) by mx08-00574e01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 42UBjZlN016009; Sat, 30 Mar 2024 11:45:35 GMT Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by mx08-00574e01.pphosted.com (PPS) with ESMTPS id 3x69tfr8t4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Sat, 30 Mar 2024 11:45:34 +0000 (GMT) Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a45acc7f191so181207666b.0 for ; Sat, 30 Mar 2024 04:45:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711799134; x=1712403934; 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=z5dF+UvoTTqDvULYJhefma+15Oi7HLq0002pNsKo95M=; b=lTc9sKvvStBP2anKkKeYix8sx9214ySWa98Wlzge9DairTutmo60bWWFGEmsmGeCe1 wq7D2fJCGNZK/LU53whbFCESMG0AH5hrISIitq2X8NFLS7iXyN88hz9KN4j2RIhrs81U 7mg4NQn9eFxdzOde9uomQPirQYcDDZt5yIUTbHP/b2k8FqiU/iUnJPJS0Aa8mO6tSKwS W5vliaQLFMeg69OtIq07w8xCfpo9Z0Q9n9MW1mXvQFR0Ro4GHVmOXUsemF7yvDyOl8Pk 5wYnMxPkdIZ0XPCmW0MlBVITtG9iCTol5ICNKnoa7eU9OPTJNB5gaywol7FtxKX7xRyn cAvg== X-Forwarded-Encrypted: i=1; AJvYcCWCoYlY7+3bcxB/fAECBRk1FwpJO8QXiZqWwbTRTBU64Yt7EAmemYNQuQ4nrvT4IrpxLW6ffYsIxvQl2n6LopdeowY6nDgzQD5z X-Gm-Message-State: AOJu0YxUbqqTjtAUY9jZTls2bLviizdyhwxymzYC7g3l+g6c5JBIReLp xafik6duS0BjrsgXRG6KOZEWhhww05k0vrBfFF5T+lOwGgR0Tjv9PS+pwDfS8bdVrd25pTKE0ku Ktukc8y1WxiU5Z2ro6rtJFtWrmuY6vcEGxF0Ems0+6CCMRVpr/H1uI09I6xxv/smMRjN5lvGDSO EFSoFFaV/r7n2QCn/cVPXY9cOW2VCUWS9nIYdm X-Received: by 2002:a17:907:74b:b0:a4e:375d:2573 with SMTP id xc11-20020a170907074b00b00a4e375d2573mr3754006ejb.37.1711799133948; Sat, 30 Mar 2024 04:45:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEmsbLYG4o4ZOUm+uFpOMR9zFfJ6oV8WBEZ1pVVTWxOsulK2vtOKWLnhsbwVYD3oGm9qDFi/1GWG1Up X-Received: by 2002:a17:907:74b:b0:a4e:375d:2573 with SMTP id xc11-20020a170907074b00b00a4e375d2573mr3753992ejb.37.1711799133680; Sat, 30 Mar 2024 04:45:33 -0700 (PDT) Received: from eu1gs1.smtp.exclaimer.net (eu1gs1.smtp.exclaimer.net. [20.50.220.144]) by smtp-relay.gmail.com with ESMTPS id bv3-20020a170907934300b00a4e4fc11850sm12250ejc.230.2024.03.30.04.45.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 30 Mar 2024 04:45:33 -0700 (PDT) X-Relaying-Domain: iress.com Received: from mail-lj1-f199.google.com (209.85.208.199) by eu1gs1.smtp.exclaimer.net (20.50.220.144) with Exclaimer Signature Manager ESMTP Proxy eu1gs1.smtp.exclaimer.net (tlsversion=TLS12, tlscipher=TLS_ECDHE_WITH_AES256_SHA1); Sat, 30 Mar 2024 11:45:33 +0000 X-ExclaimerHostedSignatures-MessageProcessed: true X-ExclaimerProxyLatency: 5262240 X-ExclaimerImprintLatency: 2682903 X-ExclaimerImprintAction: cc3c8d31437d415c9e1479b81c5e4714 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2d48af389acso19339921fa.1 for ; Sat, 30 Mar 2024 04:45:33 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCVvXMhAu1prfZGjXMY9ihtoeSa/VFf2UE454dZ6XdGKEgYOkD5QDlULgi9j2tZ263Ij4XZB07mFjnT3xl29CpOH95vfuifMgMtX X-Received: by 2002:a19:2d03:0:b0:513:bf92:79ad with SMTP id k3-20020a192d03000000b00513bf9279admr3516279lfj.45.1711799132188; Sat, 30 Mar 2024 04:45:32 -0700 (PDT) X-Received: by 2002:a19:2d03:0:b0:513:bf92:79ad with SMTP id k3-20020a192d03000000b00513bf9279admr3516267lfj.45.1711799131693; Sat, 30 Mar 2024 04:45:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Adrian Grucza Date: Sat, 30 Mar 2024 22:45: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="0000000000002c0e770614df4b10" X-Proofpoint-GUID: bxOQEqNJuUYS-PDzIYyg9_F9pBzd8VS1 X-Proofpoint-ORIG-GUID: bxOQEqNJuUYS-PDzIYyg9_F9pBzd8VS1 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. --0000000000002c0e770614df4b10 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable You might consider adding an optional "DsnProperties" string parameter to regress.ps1. When provided, the script could use that property string to create the DSN instead of calling input-dsninfo to prompt for the properties. In general I think it's preferable for CI to run tests using the same script that people use when developing psqlODBC locally. That way if the script ever breaks, then the break will be detected in CI. But I think it's also useful to test the MSI installer, which regress.ps1 doesn't do. 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 22:09, Dave Cramer wrote: > > > *CAUTION: *This Email is from an EXTERNAL source. Ensure you trust this > sender before clicking on any links or attachments. > > > > > > On Sat, 30 Mar 2024 at 06:17, Adrian Grucza > wrote: > >> If your aim is to run the regression tests then winbuild/regress.ps1 doe= s >> 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 i= n >> Docker). >> > Well the problem is that it waits for input which we can't do on github > actions > >> >> 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' ` >> ) >> >> Thanks, > > Will try this > > Dave > >> >> Adrian Grucza >> Technical Lead >> Office: +61390185800 >> 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. >> 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 sourc= e. >>>> 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 err= or >>>> 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 cre= ate data >>>>>> sources from the command line. This is all stored in the registry, w= hich >>>>>> you can update using the reg command. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> https://learn.microsoft.com/en-us/windows-server/administration/wind= ows-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 sour= ce >>>>>> using the reg file or just use it as a template to add the entries a= s you >>>>>> like. >>>>>> >>>>>> >>>>>> Just run Regedit and locate the data source you would like to export= =2E >>>>>> >>>>>> >>>>>> >>>>>> 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 reference= d >>>>>> 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, b= oth as >>>>>> a folder containing the details of the data source as well as an ent= ry >>>>>> under =E2=80=9CODBC.INI\ODBC Data Sources=E2=80=9D, which associates= the 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 sourc= e 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 str= ing >>>>>> 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 u= ser >>>>>> interaction. >>>>>> >>>>>> >>>>>> >>>>>> Has anyone done this on GH actions ? >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> Dave Cramer >>>>>> >>>>> --0000000000002c0e770614df4b10 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
You might c= onsider adding an optional "DsnProperties" string parameter to re= gress.ps1. When provided, the script could use that property string to crea= te the DSN instead of calling input-dsninfo to prompt=C2=A0for the properti= es. In general I think it's preferable for CI to run tests using the sa= me script that people use when developing psqlODBC locally. That way if the= script ever breaks, then the break will be detected in CI. But I think it&= #39;s also useful to test the MSI installer, which regress.ps1 doesn't = do.


= =
3D""
=
Adrian = ;Grucza​= ;
Technical Le= ad
Office: = ;+61390185800
=
The conte= nts of this email originated from Iress. For this purpose Iress includes Ir= ess Limited and/or any of its subsidiaries, holding companies and trading e= ntities.
​​If you have received this email in error please= notify the sender immediately and delete this email. 

<= /table>
On Sat, 30 Mar 2024 at 22:09, Dave Cramer <davecramer@gmail.com> wrote:


CAU= TION: This Email is from an EXTERNAL source. Ensure you trust th= is sender before clicking on any links or attachments.





On Sat, 30 Mar 2024 at 06:17, Adrian Grucz= a <adrian.g= rucza@iress.com> wrote:
If your aim is to run the regression = tests then winbuild/regress.ps1 does everything for you: installs a dev ver= sion of the driver, creates a DSN for it and runs the tests against a Postg= reSQL server (which you could run in Docker).
= Well the problem is that it waits for input which we can't do on github= actions=C2=A0
=

But if you want to use the MS= I installer, running that will install the driver for you:

Start-Process '= C:\\psqlodbc_x64.msi' '/quiet /passive' -PassThru | Wait-Proces= s;

You then just need to create the DSN:

Add-OdbcDsn -Name "MyPostgre= sDsn" -DsnType 'User' -Platform '64-bit' -DriverName &= #39;PostgreSQL Unicode(x64)'

Set-OdbcDsn -Name "M= yPostgresDsn" `
=C2=A0-DsnType "Use= r" `
=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>
Thanks,

W= ill try this

Dave=C2=A0

3D""
Adrian=C2=A0Grucza=
Technical=C2=A0Lead
Office:=C2=A0+61390185800
<= tbody>
The contents of this email orig= inated from Iress. For this purpose Iress includes Iress Limited and/or any= of its subsidiaries, holding companies and trading entities.
If you hav= e received this email in error please notify the sender immediately and del= ete this email.=C2=A0

On Sat, 30 Mar 2024 at 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 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=C2=A0in PowerShell, specificall= y Add-OdbcDsn and Set-OdbcDsn.


Yes, I saw those, was going to try them. I thin= k the challenge is registering the driver first though.

Dave=C2=A0

3D"iress.com"<= /td>
<= tbody><= /tr>
Adrian=C2=A0Grucza=C2=A0=C2=A0
Technical=C2=A0Lea= d
=
Office:=C2=A0+61390185800
adrian.grucza@iress.com
www.iress.com
=
<= td align=3D"left" style=3D"vertical-align:top;font-family:Arial">Level=C2= =A016=C2=A038= 5=C2=A0Bourke=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 M= ar 2024 at 2:12=E2=80=AFam, 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 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.

=C2=A0<= /span>

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:1px solid rgb(204,204,204);padding-left:1ex">
<= div>

=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

--0000000000002c0e770614df4b10--