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 1rrO95-000JwW-F8 for pgsql-odbc@arkaria.postgresql.org; Mon, 01 Apr 2024 20:20:44 +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 1rrO92-001RxL-LK for pgsql-odbc@arkaria.postgresql.org; Mon, 01 Apr 2024 20:20:41 +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 1rrO92-001RxC-15 for pgsql-odbc@lists.postgresql.org; Mon, 01 Apr 2024 20:20:41 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rrO8z-0001Ve-7p for pgsql-odbc@postgresql.org; Mon, 01 Apr 2024 20:20:39 +0000 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-56bc5a3aeb9so5580575a12.3 for ; Mon, 01 Apr 2024 13:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712002835; x=1712607635; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0jtz+t1j+tfCX/d7SZwnO4zgYUKxXaSLpDbPM0cKxCs=; b=VDtny9NVMcEqhatsVqdDNhSFr0g5jNdCXds5ej3dgyrtXnXz7RMADq/ElUE+JawFdG wbp2odzUcf9IuAM3WMGQEkCTuFzKtFl23NnjJ1bvGlk7VpsQZZf6PKSmIVjpYfEv4KPr 2tEJe37LnY7p6oo9kt4pVlFqefX3IWxSlkLYRCJeGEswnmUwZdD0WRbDdy0SSfkq+H0O GkWvxQCD97exoJ3CMffEfS6HxyDJMJh6cDLlau8S5VSNNAAMda7qlh0EWu9TfPjcTRJW p38nh2qKWB/SGbJlwxYGHA3JJFCz04GFaD4xWEtxvUNMLyyoUMaWKaL+cN3oQASKWGzL lj+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712002835; x=1712607635; 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=0jtz+t1j+tfCX/d7SZwnO4zgYUKxXaSLpDbPM0cKxCs=; b=GqpkEkHyI9IdD54/vQ8cIS0VtdJDhwgK1OMKjgCSaoZJ5mpNhi8z6StaAl7vHzEtOD nfnWM/0VFEakcyo1peJsesxz4lZogyJNIhjSJDQFq4d0FI3Mg/sE8ipcvMpwvxrUvE8m /Lk2jkuod2qh5LuFF3YYN7o+/IpMhkDV6ekGwHzziQxFvkhyZuWEFRBDUy+pdx9i7FsZ zRD67TsoNDCdWNCjOZv0W5As95BKfe8sn26lHyE83xa7LaJUz+TQ+t6rUX8qA3g3rYDh DFRo97JnD9RyMdB6hqfU6Mq1xxvzc1R9LjsC8R32N0sPKUA7ElhR3KO7nCd8Iv8AaAf7 6rmQ== X-Forwarded-Encrypted: i=1; AJvYcCXPGX8FumZpdZCHif0h5TAwN9+TvyLVnZwd5tYPWyoar4O8kiJvIi6czcxImV7CD4+9ST8rMjvvI7FiB/npzzzQiTuhdkLmw4H8 X-Gm-Message-State: AOJu0YwjpNCrulsJ1Qqv4lc5DAeJow66L6dPAG+SaJCizt7+d9RfC2u3 C4wBCZuHm0UlJuW+l9MyQq3QYArrjC09ALEoQUYwwWCppTQkbB0x29PJmjtYQb26xBbuZEjwaoJ IOm+71uAHG0j7OmijjaKflm7/amg= X-Google-Smtp-Source: AGHT+IGA/hUzeYTL3P/LGtX1G00qjqh4ZCyIn1+dBIwPzDeFaoxl/PTj3yVe0tfbxtM5f6tz4BEtcrA3BAVTW8/azII= X-Received: by 2002:a17:907:7644:b0:a46:94c7:49a5 with SMTP id kj4-20020a170907764400b00a4694c749a5mr6367282ejc.40.1712002835334; Mon, 01 Apr 2024 13:20:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Cramer Date: Mon, 1 Apr 2024 16:20:18 -0400 Message-ID: Subject: Re: How to create an ODBC datasource in CI To: Adrian Grucza Cc: Jon Raiford , PostgreSQL mailing lists Content-Type: multipart/alternative; boundary="000000000000daceb206150eb852" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000daceb206150eb852 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 30 Mar 2024 at 07:45, Adrian Grucza wrote= : > 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 wa= y > 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. > > Did that, and it works, have one test failing because libxml2 isn't installed. create database and dsn =C2=B7 davecramer/psqlodbc@982bd55 (github.com) Anyone know how to install it on windows? Dave > 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 >>> 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 co= uld >>> run in 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 Ires= s >>> includes Iress Limited and/or any of its subsidiaries, holding companie= s >>> 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 sour= ce. >>>>> 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 er= ror >>>>> 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 cr= eate data >>>>>>> sources from the command line. This is all stored in the registry, = which >>>>>>> you can update using the reg command. >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> https://learn.microsoft.com/en-us/windows-server/administration/win= dows-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 sou= rce >>>>>>> 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 expor= t. >>>>>>> >>>>>>> >>>>>>> >>>>>>> 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 referenc= ed >>>>>>> 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, = both as >>>>>>> a folder containing the details of the data source as well as an en= try >>>>>>> under =E2=80=9CODBC.INI\ODBC Data Sources=E2=80=9D, which associate= s 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 sour= ce 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 st= ring >>>>>>> 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 >>>>>>> >>>>>> --000000000000daceb206150eb852 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sat, 30 Mar 2024 = at 07:45, Adrian Grucza <adri= an.grucza@iress.com> wrote:
You might co= nsider adding an optional "DsnProperties" string parameter to reg= ress.ps1. When provided, the script could use that property string to creat= e the DSN instead of calling input-dsninfo to prompt=C2=A0for the propertie= s. In general I think it's preferable for CI to run tests using the sam= e 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 d= o.


D= id that, and it works, have one test failing because libxml2 isn't inst= alled.


=
Anyone know how to install it on windows?

Dave=C2=A0
<= div dir=3D"ltr">
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-Process;<= /div>

You then just need to create the DSN:

Add-OdbcDsn -Name "MyPostgresDs= n" -DsnType 'User' -Platform '64-bit' -DriverName '= ;PostgreSQL Unicode(x64)'

Set-OdbcDsn -Name "MyPos= tgresDsn" `
=C2=A0-DsnType "User&qu= ot; `
=C2=A0-SetPropertyValue @("Servername=3D$= {env:DB_HOST}" `
=C2=A0,'Port=3D5432' `=
=C2=A0,"SSLMode=3D${env:SSL_MODE}" `
=C2=A0,'BoolsAsChar=3D0' `
=C2=A0,'FetchRefcursors=3D1' `
=C2=A0,'= ;MaxVarcharSize=3D4094' `
=C2=A0)

Thanks,

Will = try this

Dave=C2=A0

3D""
Adrian=C2=A0Grucza
<= /tbody>
<= tr style=3D"font-size:12px">
Technical=C2=A0Lead
=
Office:= =C2=A0+61390185800
The contents of this email o= riginated 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.=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 align=3D"left" style=3D"vertical-align:top">
Adrian=C2=A0Grucza=C2=A0=C2= =A0
Tec= hnical=C2=A0Lead
Office:=C2=A0+61390= 185800
adrian.gruc= za@iress.com
www.iress.com
<= td align=3D"left" style=3D"vertical-align:top">
=
=
Level=C2=A016=C2= =A0385=C2=A0B= ourke=C2=A0St
=C2=A0Melbourne,=C2=A0Victoria,=C2=A03000
=
The contents of = this email originated from Iress. For this purpose Iress includes Iress Lim= ited and/or any of its subsidiaries, holding companies and trading entities= . If you have received this email in error please notify the sender immedia= tely and delete this email.=C2=A0
nosig
On Sat, 30 Mar 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

--000000000000daceb206150eb852--