Docker desktop & PostgreSQL & pgAdmin4 … where is the database data stored?

Hi,

I am sending data out via Node-RED, to PostgreSQL to a table that has energy
I can see this on pgAdmin4 , but I cannot find the actual data inside of Docker desktop , so that i can either bind to it or save it. Any ideas ... thanks

Also what is the extension name that PostgreSQL uses ?.


My Node-RED output node

09



My Docker desktop



And pgAdmin4

08

From your Docker Desktop display:
image

So you need to look in there for the actual data.

This is a Docker question, not a node-red one.

Hi,

Yes I know it is a docker question, I was just hoping someone else has done this with Node-RED.
I have spent 2 hours searching for the answer and also looked into Docker desktop for the data but cannot find it.

The good thing is i can see the data in pgAdmin4 that Node-RED sends :slightly_smiling_face:

Thanks

I think that is your issue. Docker Desktop is, AFAIK, simply a way to manage docker containers. To get to the guts, you need Docker commands. For example, there are ways (I can never remember the command as I don't use it often - I have to do what you need to do and that is look it up) to get a bash shell inside a running container. With that you will be able to poke around and find the actual db data. Though I'm not clear why you might want to do that.

Hi,

Thanks, I can view all files inside of Docker desktop but I just don't know where to look for the data, i think the extension should be a DAT

I just want to be able to export and import the database for safety sake and backups.

I have also asked on the Docker forum, but usually it is a very technical answer, that I don't always understand.

Like I said someone on here may, just have done something similar as that database is well known to the Node-RED community ( i think ) :thinking:

This forum is always great for help :+1:

Thanks

This may be helpful.

Note that if you want to do a simple backup by copying those files, make sure you stop the database server running first or you may backup an inconsistent set of files.

Thanks Colin

OK, you really would have been better off leading with that.

The recommendation for PostreSQL backups is to use pg_dump rather than filing system backups.

Or maybe you could snapshot your pg docker container?

Hi,

I am coming from using SQLite, so I am used to having the actual file as a backup.

But I am starting too learn that with PostgreSQL you don't do that, you use pgAdmin4 to save restore etc.
Backup Dialog — pgAdmin 4 6.21 documentation.

I am just watching some videos on using it, all very interesting, nothing like SQLite and DB browser.

Thanks for your help on this off topic question.

:+1:

1 Like