Installing HTTP Extension Windows

PostgreSQL extensions, HTTP client, Windows installation

The HTTP extension

github

Install http extension on Windows

With grit and hard work you can do it!

You can do it!

choose the right postgresql version

see https://www.postgresonline.com/journal/archives/371-http-extension.html

This will download the files somewhere on your laptop. You will need to copy them to the right place.

Once you are done installing the extension, you can check if it is installed with

select * from pg_available_extensions where name = 'http';

Once you are done installing the extension, help your classmate to install it.

check if it’s already installed

First check of the extension is already installed (you should be so lucky)

select * from pg_available_extensions where name = 'http';

If this returns 0 rows you have to install the http extension.

If this return one rows, you can ddirectly activate the extension with

CREATE EXTENSION http;

And then verify that the extension is listed with \dx

   Name   | Version |   Schema   |                                Description
----------+---------+------------+----------------------------------------------------------------------------
 http     | 1.6     | public     | HTTP client for PostgreSQL, allows web page retrieval inside the database.

see also


Instructions from chatgpt

Double check before applying. Understand what you do before applying.


🍎 macOS (All Versions) — How to Install the http Extension

1) Install PGXN Client

Open Terminal:

brew install pgxnclient

3) Install the Extension Using PGXN

pgxn install http

✅ 4) Enable the Extension in Your Database

Open psql or the pgAdmin Query Tool and run:

CREATE EXTENSION http;

Test it:

SELECT (http_get('https://httpbin.org/get')).content;

If you see JSON → ✅ Success.


🌟 Important Note for Postgres.app Users

Because Postgres.app installs multiple versions side-by-side, ensure pgxn install targeted the correct version.

Check your active server version:

psql --version

Check installed extension files:

ls /usr/local/share/postgresql/extension/ | grep http

If you used Postgres.app and things did not appear, run:

export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
pgxn install http

This ensures the extension installs into your Postgres instance.


Windows — Install the http Extension for PostgreSQL

**Requirements **

Use PowerShell (Run as Administrator)

You must use PowerShell as Administrator because we will copy files into PostgreSQL’s installation folders.

1) Determine your PostgreSQL version and install location

Open pgAdmin → connect → open Query Tool → run:

SELECT version();

You will see something like:

PostgreSQL 15.4 ...

So note: Your version = 15 (your number may differ).

Default install folder (remember this):

C:\Program Files\PostgreSQL\<your-version>\

Examples:

C:\Program Files\PostgreSQL\14\
C:\Program Files\PostgreSQL\15\
C:\Program Files\PostgreSQL\16\

2) Download the prebuilt HTTP extension files

Go to:

https://www.postgresonline.com/journal/archives/371-http-extension.html

Download the ZIP for your PostgreSQL version and architecture (most students = 64-bit).

Unzip it — you will see at least these files:

http.dll
http.control
http--1.5.sql (or similar version number)

3) Place the files in the correct directories

Open PowerShell as Administrator

(Replace 15 with your version)

cd "C:\Program Files\PostgreSQL\15\"

Copy the files:

File Destination Folder
http.dll C:\Program Files\PostgreSQL\15\lib\
*.control files C:\Program Files\PostgreSQL\15\share\extension\
*.sql files C:\Program Files\PostgreSQL\15\share\extension\

So run (replace paths to where you unzipped):

copy "C:\Users\YOURNAME\Downloads\http.dll" "C:\Program Files\PostgreSQL\15\lib\"
copy "C:\Users\YOURNAME\Downloads\http.control" "C:\Program Files\PostgreSQL\15\share\extension\"
copy "C:\Users\YOURNAME\Downloads\http--*.sql" "C:\Program Files\PostgreSQL\15\share\extension\"

Tip: If your ZIP extracted into a folder, reference that folder instead of Downloads.

4) Restart the PostgreSQL Service

Still in PowerShell (Admin):

net stop postgresql-x64-15
net start postgresql-x64-15

(Replace 15 with your version.)

5) Enable the extension inside your database

Open pgAdmin → Query Tool, then run:

CREATE EXTENSION http;

Then test:

SELECT (http_get('https://httpbin.org/get')).content;

If you see JSON → ✅ Success


✅ Summary

Step Action
1 Check Postgres version in pgAdmin
2 Download matching http extension ZIP
3 Copy http.dlllib/
4 Copy .control + .sqlshare/extension/
5 Restart PostgreSQL service
6 Run CREATE EXTENSION http in pgAdmin