Adding Postgres as a dependency

Hi, newbie snapcrafter here tinkering around trying to build my first snap.

I have a simple snapcraft for now with the following part:

parts:
  syncv3:
    plugin: go
    source: .
    build-snaps:
      - go
    stage-packages:
      - postgresql

This builds fine and I can run the built product. So next step I’m adding an install hook to create the postgres database. I have the following in snap/hooks/install:

#!/bin/sh
set -e

# Create the database
createdb syncv3

However this fails when I’m trying to install the snap with the following:

- Run install hook of "sliding-sync" snap if present (run hook "install": 
-----
Can't locate PgCommon.pm in @INC (you may need to install the PgCommon module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl) at /snap/sliding-sync/x1/usr/bin/createdb line 22.
BEGIN failed--compilation aborted at /snap/sliding-sync/x1/usr/bin/createdb line 22.
-----)

At this point I’m a bit lost, have I added the dependency correctly? I was going to use it via stage-snaps but the postgres snap looks pretty out of date.