Thread: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

[HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Paresh More
Date:
Hello Team

This is regarding Tcl version (8.6) support in PostgreSQL.

Currently in PostgreSQL server file  (src/tools/msvc/Mkvcbuild.pm) it supports only till Tcl version 8.5

Attach patch contains adding Tcl 8.6 support.
 

Please Note - In Tcl8.6, the library name now contains an extra 't" in it. 
Tcl 8.6 - tcl86t.lib
Tcl 8.5 - tcl85.lib

Can you please review the patch and commit for PostgreSQL.


--

Thanks & Regards

Paresh More

NEW-EDB-logo-4c

Pune, India.

Attachment

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Sandeep Thakkar
Date:
Tcl8.6 is already supported in PostgreSQL. It was just missing the required changes for Windows build system. Can someone please review and commit the attached patches?

- Mkvcbuild_Tcl86_94-92.patch (This applies to 9.4, 9.3 and 9.2)
- Mkvcbuild_Tcl86_95-master.patch (This applies to 9.5, 9.6 and master)

Thanks.

On Thu, Apr 20, 2017 at 2:02 PM, Paresh More <paresh.more@enterprisedb.com> wrote:
Hello Team

This is regarding Tcl version (8.6) support in PostgreSQL.

Currently in PostgreSQL server file  (src/tools/msvc/Mkvcbuild.pm) it supports only till Tcl version 8.5

Attach patch contains adding Tcl 8.6 support.
 

Please Note - In Tcl8.6, the library name now contains an extra 't" in it. 
Tcl 8.6 - tcl86t.lib
Tcl 8.5 - tcl85.lib

Can you please review the patch and commit for PostgreSQL.


--

Thanks & Regards

Paresh More

NEW-EDB-logo-4c

Pune, India.




--
Sandeep Thakkar
EDB


Attachment

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Robert Haas
Date:
On Sat, Apr 22, 2017 at 1:58 PM, Sandeep Thakkar <sandeep.thakkar@enterprisedb.com> wrote:
Tcl8.6 is already supported in PostgreSQL.

What commit added support for it?
 
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Andres Freund
Date:
On 2017-04-24 16:18:30 -0400, Robert Haas wrote:
> On Sat, Apr 22, 2017 at 1:58 PM, Sandeep Thakkar <
> sandeep.thakkar@enterprisedb.com> wrote:
> 
> > Tcl8.6 is already supported in PostgreSQL.
> >
> 
> What commit added support for it?

I don't think the main build mechanism requires explicit support of new
versions. configure just checks for some prerequisites.

- Andres



Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Dave Page
Date:


On Mon, Apr 24, 2017 at 9:26 PM, Andres Freund <andres@anarazel.de> wrote:
On 2017-04-24 16:18:30 -0400, Robert Haas wrote:
> On Sat, Apr 22, 2017 at 1:58 PM, Sandeep Thakkar <
> sandeep.thakkar@enterprisedb.com> wrote:
>
> > Tcl8.6 is already supported in PostgreSQL.
> >
>
> What commit added support for it?

I don't think the main build mechanism requires explicit support of new
versions. configure just checks for some prerequisites.



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Sandeep Thakkar
Date:


On Tue, Apr 25, 2017 at 1:59 AM, Dave Page <dpage@pgadmin.org> wrote:


On Mon, Apr 24, 2017 at 9:26 PM, Andres Freund <andres@anarazel.de> wrote:
On 2017-04-24 16:18:30 -0400, Robert Haas wrote:
> On Sat, Apr 22, 2017 at 1:58 PM, Sandeep Thakkar <
> sandeep.thakkar@enterprisedb.com> wrote:
>
> > Tcl8.6 is already supported in PostgreSQL.
> >
>
> What commit added support for it?

I don't think the main build mechanism requires explicit support of new
versions. configure just checks for some prerequisites.


Right and it was back-patched till 9.2. But, it missed the changes required for Windows build. So, can anyone please review those two patches i.e Mkvcbuild_Tcl86_94-92.patch and Mkvcbuild_Tcl86_95-master.patch and commit? With this patch, we could build the server with Tcl8.6 on Windows. Thanks!



--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--
Sandeep Thakkar
EDB


Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Andres Freund
Date:
Hi,

On 2017-04-22 23:28:49 +0530, Sandeep Thakkar wrote:
> diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
> index 304edf9..d3ef89f 100644
> --- a/src/tools/msvc/Mkvcbuild.pm
> +++ b/src/tools/msvc/Mkvcbuild.pm
> @@ -253,7 +253,12 @@ sub mkvcbuild
>            $solution->AddProject('pltcl', 'dll', 'PLs', 'src\pl\tcl');
>          $pltcl->AddIncludeDir($solution->{options}->{tcl} . '\include');
>          $pltcl->AddReference($postgres);
> -        if (-e $solution->{options}->{tcl} . '\lib\tcl85.lib')
> +        if (-e $solution->{options}->{tcl} . '\lib\tcl86t.lib')
> +        {
> +            $pltcl->AddLibrary(
> +                $solution->{options}->{tcl} . '\lib\tcl86t.lib');
> +        }
> +        elsif (-e $solution->{options}->{tcl} . '\lib\tcl85.lib')
>          {
>              $pltcl->AddLibrary(
>                  $solution->{options}->{tcl} . '\lib\tcl85.lib');

> diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
> index 30c1265..2667591 100644
> --- a/src/tools/msvc/Mkvcbuild.pm
> +++ b/src/tools/msvc/Mkvcbuild.pm
> @@ -208,7 +208,12 @@ sub mkvcbuild
>            $solution->AddProject('pltcl', 'dll', 'PLs', 'src/pl/tcl');
>          $pltcl->AddIncludeDir($solution->{options}->{tcl} . '/include');
>          $pltcl->AddReference($postgres);
> -        if (-e $solution->{options}->{tcl} . '/lib/tcl85.lib')
> +        if (-e $solution->{options}->{tcl} . '/lib/tcl86t.lib')
> +        {
> +            $pltcl->AddLibrary(
> +                $solution->{options}->{tcl} . '/lib/tcl86t.lib');
> +        }
> +        elsif (-e $solution->{options}->{tcl} . '/lib/tcl85.lib')
>          {
>              $pltcl->AddLibrary(
>                  $solution->{options}->{tcl} . '/lib/tcl85.lib');

Any chance of formulating these in a version agnostic way, instead of
copying the same stanza for every version?  E.g. using a wildcard or
such...

Greetings,

Andres Freund



Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Michael Paquier
Date:
On Tue, Apr 25, 2017 at 2:57 PM, Andres Freund <andres@anarazel.de> wrote:
> Any chance of formulating these in a version agnostic way, instead of
> copying the same stanza for every version?  E.g. using a wildcard or
> such...

Using glob() would be enough for this purpose.
-- 
Michael



Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Tom Lane
Date:
Michael Paquier <michael.paquier@gmail.com> writes:
> On Tue, Apr 25, 2017 at 2:57 PM, Andres Freund <andres@anarazel.de> wrote:
>> Any chance of formulating these in a version agnostic way, instead of
>> copying the same stanza for every version?  E.g. using a wildcard or
>> such...

> Using glob() would be enough for this purpose.

Not really, because glob() wouldn't enforce any preference over which
of multiple versions to pick.  If anything, it would do exactly the
wrong thing, preferring an older tclsh version over a newer one.

But I agree with Andres' complaint that just duplicating the code isn't
the best way.  The configure script has a loop that's basically like

for f in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84 tclsh8.3 tclsh83
do  ... break if $f is the right one
done

Seems to me that a similar coding pattern in the MSVC script is a
reasonable way to go.
        regards, tom lane



Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Alvaro Herrera
Date:
Tom Lane wrote:

> But I agree with Andres' complaint that just duplicating the code isn't
> the best way.  The configure script has a loop that's basically like
> 
> for f in tclsh tcl tclsh8.6 tclsh86 tclsh8.5 tclsh85 tclsh8.4 tclsh84 tclsh8.3 tclsh83
> do
>    ... break if $f is the right one
> done
> 
> Seems to me that a similar coding pattern in the MSVC script is a
> reasonable way to go.

Something like the (untested) attached perhaps?

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachment

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Tom Lane
Date:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Something like the (untested) attached perhaps?

Looks plausible, I'm not in a position to test though.
        regards, tom lane



Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Dave Page
Date:


On Thu, May 4, 2017 at 3:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Something like the (untested) attached perhaps?

Looks plausible, I'm not in a position to test though.

Sandeep/Paresh - can you test please?
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Paresh More
Date:
Hello Alvaro,

I applied the patch which you mentioned and tried compiling  postgresql server for windows 32 and 64 and the results are:-

1) postgresql server(96) with tcl version 8.5 is compiling fine with out any issue.
2) postgresql server(10) snapshot with tcl version 8.6 is also compiling fine without any issue.






On Thu, May 4, 2017 at 8:26 PM, Dave Page <dpage@pgadmin.org> wrote:


On Thu, May 4, 2017 at 3:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Something like the (untested) attached perhaps?

Looks plausible, I'm not in a position to test though.

Sandeep/Paresh - can you test please?
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



--

Thanks & Regards

Paresh More

NEW-EDB-logo-4c

Pune, India.

Cell :  +919922000564 |  www.enterprisedb.com

Re: [HACKERS] Patch - Tcl 8.6 version support for PostgreSQL

From
Alvaro Herrera
Date:
Paresh More wrote:
> Hello Alvaro,
> 
> I applied the patch which you mentioned and tried compiling  postgresql
> server for windows 32 and 64 and the results are:-
> 
> 1) postgresql server(96) with tcl version 8.5 is compiling fine with out
> any issue.
> 2) postgresql server(10) snapshot with tcl version 8.6 is also
> compiling fine without any issue.

Great, will push.


-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services