To usepgpkg, you need to be able to access a Postgresql database. You don't need superuser access, but you do need privileges including the ability to create database schemas and roles.
NOTE:
pgpkguses the samePGDATABASEand other environment variables aspsql. It does not yet support command-line options to override the environment. You can also use aDSNenvironment variable to use a URL-style connection string.
You currently need Go 1.20 installed (we will release binary packages soon).
If you have a superuser account on your Postgresql instance, you can skip this section.
pgpkg is designed to work with reduced permissions, which may be necessary for hosted Postgres databases such as Supabase or Vultr.
To create a database user pkgadm with sufficient privileges to install a package:
create role pkgadm with createrole login password {{password-in-single-quotes}};
grant create on database {{PGDATABASE}} to pkgadm;
Then before running pgpkg, you need to set the PG environment:
export PGUSER=pkgadm
export PGPASSWORD={{password-in-single-quotes}}
pgpkg will automatically create roles for each package that it installs. These roles
will be prefixed with $ so that they can be easily differentiated from regular roles.
Note however that if you use $ in your own role names, collisions may be possible.