Installation¶
This guide will walk you through installing pgraft on your system.
Prerequisites¶
Before installing pgraft, ensure you have the following:
- PostgreSQL: Version 17.6 or higher
- Go: Version 1.21 or higher
- GCC: C compiler
- PostgreSQL development headers
System-Specific Prerequisites¶
Build from Source¶
1. Clone the Repository¶
2. Build the Extension¶
Check for Errors
You can verify the build completed without errors:
3. Install the Extension¶
# Manual installation
cp pgraft.dylib /usr/local/pgsql.17/lib/
cp src/pgraft_go.dylib /usr/local/pgsql.17/lib/
cp pgraft.control /usr/local/pgsql.17/share/extension/
cp pgraft--1.0.sql /usr/local/pgsql.17/share/extension/
Path Configuration
Adjust the paths above based on your PostgreSQL installation location. Common paths:
- macOS (Homebrew):
/usr/local/opt/postgresql@17/
- Linux:
/usr/lib/postgresql/17/
- Custom: Use
pg_config --libdir
andpg_config --sharedir
Verify Installation¶
After installation, verify that pgraft is properly installed:
# Check that the extension files exist
ls -l $(pg_config --libdir)/pgraft*.dylib
ls -l $(pg_config --sharedir)/extension/pgraft*
Next Steps¶
Now that pgraft is installed, you can:
Troubleshooting¶
PostgreSQL Development Headers Not Found¶
If you get errors about missing PostgreSQL headers during build:
# Ubuntu/Debian
sudo apt-get install postgresql-server-dev-17
# CentOS/RHEL
sudo yum install postgresql17-devel
Go Not Found¶
Ensure Go is installed and in your PATH:
Permission Denied¶
If you get permission errors during installation: