Adapt psql commands to environment.