How to run PG_DUMP on OSX

Mike Matthews - Omnis omnis at lineal.co.uk
Tue Feb 28 15:18:02 UTC 2023


Hello All,

How do you all run PG_DUMP to get a backup out of a Postgres database.

We use an AppleScript to do ours on OSX like this:

Begin text block
Text:tell application "Finder"(Carriage return)
Text:do shell script "
Text:PGPASSWORD='[lvSessionRow.superuserpassword]' /Library/PostgreSQL/[lvVersion]/bin/pg_dump [databasename] >
Text: '[pDestinationPathForSQLDBExport]/[pFileName].sql' -U [lvSessionRow.superusername] -p ‘5432' -h [lvSessionRow.hostname] -Fc
Text:"(Carriage return)
Text:end tell(Carriage return)
End text block

Get text block lvScript


Do $runapplescript(lvScript,lvScriptResult,lvAppleScriptError) Returns lvErrorCode

Are we making any mistakes or wrong assumptions here?

Is this the best way to get PG_DUMP to run?

So far, we have used this to create backups, which we have been able to re-import back into Postgres without obvious issue over the past 5 years.

Thanks

Mike Matthews

Lineal Software Solutions
Commercial House, The Strand<x-apple-data-detectors://1/1> Barnstaple, Devon, EX31 1EU<x-apple-data-detectors://1/1>

omnis at lineal.co.uk<mailto:mike.matthews at lineal.co.uk>

www.lineal.co.uk<http://www.lineal.co.uk/>

www.sqlworks.co.uk<http://www.sqlworks.co/>





More information about the omnisdev-en mailing list