#!/bin/sh

set -eu

if [ "$(id -u)" = "0" ]; then
	SH="su postgres"
else
	SH="sh"
fi

set -x

for v in $(pg_buildext supported-versions); do
	$SH -c "pg_virtualenv -v $v psql -c 'CREATE EXTENSION omnidb_plugin'"
done
