As of PostgreSQL 17, the Windows download from EDB no longer includes the Language Pack that was previously part of the Stack Builder utility. To enable PL/Tcl, you must install Tcl separately. This guide walks you through the steps to enable PL/Tcl on PostgreSQL 17 on Windows.
Important Note At the time of writing, PL/Tcl requires Tcl version 8.6.X. It is not compatible with Tcl 9.
Download the **Batteries Included (64-bit)** installer for Tcl 8.6.16 from the following link: Download Tcl 8.6.16
Run the installer and install Tcl to the "C:\Tcl" directory.
Add the "C:\Tcl\bin" folder to the global "PATH" environment variable:
Restart Windows to ensure the PATH changes take effect.
The "pltcl.dll" file in PostgreSQL expects the Tcl DLL to be named "tcl86t.dll". To resolve this:
Alternatively, you can create a symbolic link:
mklink "C:\Tcl\bin\tcl86t.dll" "C:\Tcl\bin\tcl86.dll"
Restart the PostgreSQL service to apply the changes:
net stop postgresql-x64-17
net start postgresql-x64-17Open "psql" or your preferred PostgreSQL client and run the following command:
CREATE EXTENSION pltcl;
Verify that PL/Tcl is installed and functioning:
Check Available Extensions:
SELECT name, installed_version
FROM pg_available_extensions
WHERE name = 'pltcl';Check Language Availability:
SELECT lanname, lanpltrusted
FROM pg_language
WHERE lanname = 'pltcl';Run a Simple PL/Tcl Function:
CREATE FUNCTION tcl_test() RETURNS text AS $$
return "Hello, PL/Tcl!"
$$ LANGUAGE pltcl;
SELECT tcl_test();If everything is set up correctly, the function should return:
Hello, PL/Tcl!