#!/bin/sh
#
# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#
#ident	"@(#)checkinstall	1.2	07/04/24 SMI"
#

error()
{
	echo "Error: No \"postgres\" uid and/or gid found."
	echo "Please install the patch for 6438076 (Add default uid/group for Postgres)."
	echo "The patch needed is 125367-01 for SPARC and 125368-01 for x86 systems."
	exit 1
}

grep "^postgres:" ${PKG_INSTALL_ROOT}/etc/passwd >/dev/null 2>&1
if [ $? -ne 0 ]
then
	error
fi

grep "^postgres:" ${PKG_INSTALL_ROOT}/etc/group >/dev/null 2>&1
if [ $? -ne 0 ]
then
	error
fi

exit 0
