En realidad tu no necesitas ereg para dividirlas usa mejor
explode() Código PHP:
function cambiaPostgre($fecha) {
$mifecha = explode("/", $fecha);
$lafecha=$mifecha[2]."-".$mifecha[1]."-".$mifecha[0];
return $lafecha;
}
echo cambiaPostgre("28/06/2009");