#!/bin/sh # this test is due to: # http://redmine.alpinelinux.org/issues/503 # pllua test is from: # http://pllua.projects.postgresql.org/ apk_add postgresql pllua /etc/init.d/postgresql start # create db and pllua language psql -U postgres -c 'create database aptstest' psql -U postgres -f /usr/share/postgresql/contrib/pllua.sql aptstest # create function psql -U postgres -d aptstest -c ' CREATE FUNCTION hello(name text) RETURNS text AS $$ return string.format("hello:%s", name) $$ LANGUAGE pllua; ' # test that lua function works psql -U postgres -d aptstest -c "SELECT hello('lua');" | grep 'hello:lua' # cleanup psql -U postgres -c 'drop database aptstest' /etc/init.d/postgresql stop apk_del pllua postgresql