Re: pg_dumpall: could not connect to database "template1": FATAL:

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: aws backup <albatin(dot)saltanat(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dumpall: could not connect to database "template1": FATAL:
Date: 2016-11-13 21:12:27
Message-ID: 0c8722b4-378f-8b06-ae7b-deb557372c29@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/13/2016 01:01 PM, aws backup wrote:
> Hi,
>
> thank you so much.
> With your help I could solve all my problems.
> DaVinci has a bug somewhere with the database configuration.
> I installed everything new and set all auth method to trust instead of md5 which was default from DaVinci.

Just remember that trust is just that, trust. If someone knows a valid
username they have access, subject to other conditions set in pg_hba.conf.

> Now everything is working as expected. No errors anymore with the backup and restore buttons in DaVinci which are just linked to the pg_dump and pg_restore scripts.
> The pg_dumpall approach was from the example scripts which are posted in the DaVinci Forum.
> But this approach doesn't make sense … ?

It does if you want to backup the state of the entire cluster. Could be
that DaVinci is including things in the template1 and postgres databases
that are needed. The other thing that pg_dumpall gets you is data global
to the cluster:

https://www.postgresql.org/docs/9.5/static/app-pg-dumpall.html

" ... pg_dumpall also dumps global objects that are common to all
databases. (pg_dump does not save these objects.) ..."

Though you can have your cake and eat it to by using pg_dump for
individual databases and then

pg_dumpall -g

where -g is:

"-g
--globals-only

Dump only global objects (roles and tablespaces), no databases.
"

>
> Best Regards,
> Robert
>
>
>
>> On 13 Nov 2016, at 19:13, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> wrote:
>>
>> On 11/13/2016 09:04 AM, aws backup wrote:
>>> Hi Adrian,
>>>
>>> thank you for the explanation.
>>> I will look into you links.
>>>
>>> I am doing this because I want to make backups from the
>>> database. Ideally automatic backups every night.
>>> The Blackmagic support says they can't help me with this. The Backup and
>>> Restore button in DaVinci does not work.
>>> Every database related question I ask the Blackmagic support stays
>>> unanswered.
>>
>> Guessing they are treating the Postgres database as an embedded one that should not be touched by the end user.
>>
>>> For example: How can I restart the SQL server? Oh sorry we can't help
>>> you with this … ?
>>
>> https://www.postgresql.org/docs/9.5/static/app-pg-ctl.html
>>
>>>
>>> Thank you.
>>> Robert
>>>
>>>
>>>
>>>
>> --
>> Adrian Klaver
>> adrian(dot)klaver(at)aklaver(dot)com
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Guillaume Lelarge 2016-11-13 21:23:41 Re: Exclude pg_largeobject form pg_dump
Previous Message aws backup 2016-11-13 21:01:57 Re: pg_dumpall: could not connect to database "template1": FATAL: