Can't find the PostgreSQL client library (libpq)
Asked Answered
V

23

174

I'm trying to install PostgreSQL for Rails on Mac OS X 10.6. First I tried the MacPorts install but that didn't go well so I did the one-click DMG install. That seemed to work.

I suspect I need to install the PostgreSQL development packages but I have no idea how to do that on OS X.

Here's what I get when I try to do sudo gem install pg:

$ sudo gem install pg
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

        /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /Library/PostgreSQL/8.3/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
    --with-ms/libpqlib
    --without-ms/libpqlib


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/pg-0.11.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/pg-0.11.0/ext/gem_make.out
Verdict answered 2/6, 2011 at 2:28 Comment(4)
Did you install version 8.3 of postgresql or is it picking up some old install? If it is 8.3 libraries should be in /Library/PostgreSQL/8.3/lib please check if it is there.Dishpan
I did version 8.3 and, yes, it looks like everything is there.Verdict
Can you post the output from pg_config? That should make it easier for us to help.Wolffish
I had to add the version -v '0.14.0' so that it worked with with mu projectUltrasonics
V
25

Solution: reinstalled PostgreSQL with Homebrew.

Verdict answered 15/6, 2011 at 20:28 Comment(5)
Congrats! Remember to award the bounty to someone. A few folks tried hard to help, even if it wasn't the final solution, and the reputation points were already spent when you offered the bounty.Wolffish
Not sure why this is got a -1, worked for me when non of the other methods didLetrice
I also ended up having to use the ARCHFLAGS method, but it didn't work until after reinstalling postresql with homebrew.Bicuspid
Worked for Yosemite (10.10.3). brew install PostgreSQLMassicot
This didn't work for me. Wonder if it has something to do with the fact that I'm using the "built in" Ruby (I think) instead of anything else :|Gleeson
P
356
$ sudo su

$ env ARCHFLAGS="-arch x86_64" gem install pg

Building native extensions.  This could take a while...
Successfully installed pg-0.11.0
1 gem installed
Installing ri documentation for pg-0.11.0...
Installing RDoc documentation for pg-0.11.0...

WORKED!

Peyote answered 21/9, 2011 at 9:44 Comment(10)
I had to add the version "env ARCHFLAGS="-arch x86_64" gem install -v '0.14.0'" so that it worked with with my projectUltrasonics
Worked for OS X Mavericks. For me, it's env ARCHFLAGS="-arch x86_64" gem install pg -v '0.17.1' -- --with-pg-config=/opt/local/lib/postgresql91/bin/pg_configTutty
This worked for me. I am using OSX 10.9.3 with Postgres app 9.3 sudo env ARCHFLAGS="-arch i386" gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_configCardamom
And if you use "Postgres.app", under mavericks, you should do : env ARCHFLAGS="-arch x86_64 gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config (Assume you use Postgres.app version 9.3, because the location of pg_config maybe changed if you use different version, but anyway you can find it)Purcell
This worked for me and broke a 2 hour stoppage. I'm new to rails and this was frustrating. Like the previous commenter, I was using the Postgres.app installer on Mavericks. Did not realize the ARCHFLGS env variable was so important. Explanation here.Critter
Also, if you're using Bundler, env ARCHFLAGS="-arch x86_64" bundle will work correctly so you don't have to install the gem globally.Assyrian
YangDawei's answer worked for me by modifying the path for the Postgres.app as detailed here: github.com/econchick/new-coder/issues/142Dilatation
How to specify this in the bundle file?Bewley
The question is, why does this work? What does "ARCHFLAGS="-arch x86_64" do, and why doesn't the vanilla gem install work? It shouldn't be this tricky to install a gem.Trousers
For this to work with bundler, add export ARCHFLAGS="-arch x86_64" to your ~/.bash_profile. Open a new terminal window and run bundle install. Bundler doesn't have a configuration option for environmental variables so putting this in your .bash_profile will make it available to bundler when it goes to run gem install.Niles
G
80

I tried the top-rated answer here:

env ARCHFLAGS="-arch x86_64" gem install pg

But when I tried running bundle install again, it had the same error. Then I tried the entire bundle install with ARCHFLAGS like so:

ARCHFLAGS="-arch x86_64" bundle install

Worked for me! Make sure to replace x86_64 with i386 depending on what architecture you have.

Goldia answered 29/4, 2015 at 19:21 Comment(3)
Thank you so much. This is what worked for me. I've been trying to resolve this issue for an hour plus now, and this code is what did it - ARCHFLAGS="-arch x86_64" bundle installPsychomancy
@Psychomancy 's addition here worked for me on High SierraNovara
Appreciated for @Christine, it's worked for me on High SierraContrarious
A
35

The error message is right there:

Can't find the PostgreSQL client library (libpq)

You can fix that by using homebrew to install it

brew install libpq

The following, or a similar, message will appear:

If you need to have libpq first in your PATH, run:
  echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc

For compilers to find libpq you may need to set:
  export LDFLAGS="-L/opt/homebrew/opt/libpq/lib"
  export CPPFLAGS="-I/opt/homebrew/opt/libpq/include"

You can then run it:

export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
gem install pg

Done.

Agreed answered 2/5, 2021 at 23:26 Comment(4)
Awesome! It works on a MacBook Pro M1. Thanks for the update!Leyla
Thanks a lot! That helped as well for MacBook Pro M1.Rianna
Worked on my M1 MacBook Air, thanks!Hola
it works macbook pro M1 2021Olgaolguin
T
31

I was just having this problem when using the EnterpiseDB .dmg. If that's the same think you used, I got it to work by specifying the right architecture:

sudo env ARCHFLAGS="-arch i386" gem install pg

There are some tutorials on the web that said to specify a different architecture (like "-arch x86_64" for people who used MacPorts) but it wasn't working for me because I used the single file install.

Tamah answered 8/6, 2011 at 16:48 Comment(2)
x86_64 worked for me (Mac OS 10.6.8, PostgreSQL installed via homebrew: mxcl.github.com/homebrew)Abdullah
Have used hours to find a solution and yours worked, bobfet1 & @chester. Thanks! :-))) ** sudo env ARCHFLAGS="-arch x86_64" gem install pg **Yeanling
V
25

Solution: reinstalled PostgreSQL with Homebrew.

Verdict answered 15/6, 2011 at 20:28 Comment(5)
Congrats! Remember to award the bounty to someone. A few folks tried hard to help, even if it wasn't the final solution, and the reputation points were already spent when you offered the bounty.Wolffish
Not sure why this is got a -1, worked for me when non of the other methods didLetrice
I also ended up having to use the ARCHFLAGS method, but it didn't work until after reinstalling postresql with homebrew.Bicuspid
Worked for Yosemite (10.10.3). brew install PostgreSQLMassicot
This didn't work for me. Wonder if it has something to do with the fact that I'm using the "built in" Ruby (I think) instead of anything else :|Gleeson
A
25

If using Yosemite:

brew install postgres

Then:

ARCHFLAGS="-arch x86_64" gem install pg

And (optional) finally, if you want to launch autovacuum...

postgres -D /usr/local/var/postgres
Avowal answered 28/1, 2015 at 19:32 Comment(0)
D
21

Maybe you can try this one:

ARCHFLAGS="-arch i386 -arch x86_64" gem install pg

To know the architecture of your library you can use

file /usr/local/lib/libpq.dylib 

which gave just 1 architecture in my case (installed via homebrew):

/usr/local/lib/libpq.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Dystrophy answered 12/6, 2011 at 18:26 Comment(2)
+1 Thanks for the hint about knowing which architecture my library was!China
Also check the architecture of your ruby binary.Plectron
A
19

If you are getting this error in Mac M1 pro, Silicon chip

Issue:

checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)

Solution:

Install libpq via homebrew and add it to the PATH

brew install libpq
echo 'export PATH="/opt/homebrew/opt/libpq/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
OR ~/bash_profile if you use it instead.

Try:

bundle install # OR
gem install pg

This works for me.

Armil answered 10/5, 2022 at 6:51 Comment(0)
I
17

Most of those answers focus on giving you one command that just works. However they only work for some particular scenarii. If you have trouble figuring out which command you should run, you better understand what is happening.

Why doesn't it work?

The pg gem is a native extension written in C. It relies on the libpq library which is the PostgreSQL library for C applications.

So, during its build, the pg gem needs to be able to find the library libqp compiled for the same architecture (for example x86_64 or arm64).

There can be a mismatch if:

  • you are on a m1 macbook (apple silicon) but have installed postgres in rosetta 2 mode.
  • you are on a 64-bit computer but have installed postgres in 32-bit mode.

If you end up in this situation, you have several options:

  • try to compile the pg gem in the same architecture as postgres
  • reinstall postgres to match the architecture in which the pg gem is built (by default it's the same as ruby's)

Example

For instance, in my case, I have a m1 macbook. I have installed ruby in "rosetta 2" mode (x86_64) and postgres in "native" mode (arm64).

You can check the architecture with the lipo -info command:

which ruby
# You might need to use a different command if you use a ruby version manager
# "which ruby" if you use rvm
# "rbenv which ruby" if you use rbenv
# "asdf which ruby" if you use asdf
=> /Users/leo/.rbenv/versions/2.6.6/bin/ruby

lipo -info /Users/leo/.rbenv/versions/2.6.6/bin/ruby
=> /Users/leo/.rbenv/versions/2.6.6/bin/ruby is architecture: x86_64
which postgres
=> /opt/homebrew/bin/pg_config

lipo -info /opt/homebrew/bin/pg_config
=> Non-fat file: /opt/homebrew/bin/pg_config is architecture: arm64

To solve this, in my case, I just had to add to the PATH another version of postgres compiled in x86_64. It allowed the pg gem to be able to find binaries in the right architecture:

export PATH=/usr/local/Cellar/postgresql/13.2_1/bin:$PATH
gem install pg

# and finally 🎉
=> Building native extensions. This could take a while...
=> Successfully installed pg-1.2.3
=> Parsing documentation for pg-1.2.3
=> Installing ri documentation for pg-1.2.3
=> Done installing documentation for pg after 1 seconds
=> 1 gem installed
Indigene answered 15/7, 2021 at 22:20 Comment(3)
Thanks for helping me understand the underlying issue. I was able to fix my issue after failing with all of the above answers.Affectionate
Thanks - this was exactly my problem and thanks for explaining !Restivo
Out of all the solutions present on internet, this one actually works. Thanks @leoSteib
S
6

Fake out gem by prefixing the appropriate environment variables. If you were installing from MacPorts, you should be able to walk through the following procedure:

% /opt/local/lib/postgresql91/bin/pg_config
BINDIR = /opt/local/lib/postgresql91/bin
DOCDIR = /opt/local/share/doc/postgresql
HTMLDIR = /opt/local/share/doc/postgresql
INCLUDEDIR = /opt/local/include/postgresql91
PKGINCLUDEDIR = /opt/local/include/postgresql91
INCLUDEDIR-SERVER = /opt/local/include/postgresql91/server
LIBDIR = /opt/local/lib/postgresql91
PKGLIBDIR = /opt/local/lib/postgresql91
LOCALEDIR = /opt/local/share/locale
MANDIR = /opt/local/share/man
SHAREDIR = /opt/local/share/postgresql91
SYSCONFDIR = /opt/local/etc/postgresql91
PGXS = /opt/local/lib/postgresql91/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--prefix=/opt/local' '--sysconfdir=/opt/local/etc/postgresql91' '--bindir=/opt/local/lib/postgresql91/bin' '--libdir=/opt/local/lib/postgresql91' '--includedir=/opt/local/include/postgresql91' '--datadir=/opt/local/share/postgresql91' '--mandir=/opt/local/share/man' '--with-includes=/opt/local/include' '--with-libraries=/opt/local/lib' '--with-openssl' '--with-bonjour' '--with-readline' '--with-zlib' '--with-libxml' '--with-libxslt' '--enable-thread-safety' '--enable-integer-datetimes' '--with-ossp-uuid' 'CC=/usr/bin/gcc-4.2' 'CFLAGS=-pipe -O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib -arch x86_64' 'CPPFLAGS=-I/opt/local/include -I/opt/local/include/ossp'
CC = /usr/bin/gcc-4.2
CPPFLAGS = -I/opt/local/include -I/opt/local/include/ossp -I/opt/local/include/libxml2 -I/opt/local/include
CFLAGS = -pipe -O2 -arch x86_64 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv
CFLAGS_SL = 
LDFLAGS = -L/opt/local/lib -arch x86_64 -L/opt/local/lib -L/opt/local/lib -Wl,-dead_strip_dylibs
LDFLAGS_EX = 
LDFLAGS_SL = 
LIBS = -lpgport -lxslt -lxml2 -lssl -lcrypto -lz -lreadline -lm 
VERSION = PostgreSQL 9.1beta1

From there, pull out the LIBDIR, INCLUDEDIR, CPPFLAGS, LIBS and LDFLAGS (the one that I think will get you running is LIBDIR, however). Then you'd run:

setenv PATH /opt/local/lib/postgresql91/bin:${PATH}
sudo env LDFLAGS=-L`pg_config --libdir` CPPFLAGS=`pg_config --cppflags` gem install pg

That should do it for you. Let me know if it doesn't.

Stonechat answered 2/6, 2011 at 18:42 Comment(9)
I used the one-click installer instead of MacPorts for PostgreSQL. I don't know what the equivalent command would be.Verdict
See if you get lucky with this (I think Mac's updatedb script runs on Saturday night): locate pg_configStonechat
I still don't know what that would mean for CPPFLAGS or LDFLAGS (I don't know what those are, sorry).Verdict
Oh, but locate pg_config did show me some stuff, though. And I tried just installing PostgreSQL via MacPorts and using your command - didn't work.Verdict
What was the error message? And did you add the path of pg_config to your PATH?Stonechat
The output I get with your command is the same exact thing as what I originally got. And yes, I did add the path of pg_config to my PATH.Verdict
Updated the above example. I believe that this will solve your problem. The catch was that LDFLAGS wasn't set to the directory that contained libpq. See above for details.Stonechat
This post may also be helpful. It addresses the same issue by simply putting a symlink to the correct file location in one of the directories already pointed to by LDFLAGS.Galah
@JanHettich That works as a hack, but can lead to some very difficult to track down bugs in the event that the ABI is different. It's good that in that example, however, the symlink wasn't setup for "libpq.so" instead it was for the specific version. It's also very brittle, but in a one-off it works quite well and I can't count the number of times I've had to do that (e.g. linking against EnterpriseDB's copy of PostgreSQL).Stonechat
C
5

The problem we had was pretty weird.

ruby -v # was ok (rbenv)
gem -v # was ok (rbenv)

but when we did a bundle install in fact, bundler wasn't installed for the version of ruby that was installed by rbenv, so, when we typed bundle install, it used the bundler of the system.

So before running bundle install, be sure that you have installed bundler by running

gem install bundler
Curcuma answered 8/10, 2012 at 15:1 Comment(1)
This worked in my case (fresh macOS High Sierra, using rbenv and installing mostly with brew). Bundle was likely using things from apple, that was the problem...Footstone
S
5

libpq from Postgres.app will not work on ARM-based Macs, as Postgres.app is not getting released for ARM (only Universal Intel/ARM packages get released, which is just x86_64 emulation on ARM64):

~ > file /Applications/Postgres.app/Contents/Versions/13/lib/libpq.dylib
/Applications/Postgres.app/Contents/Versions/13/lib/libpq.dylib: Mach-O 64-bit dynamically linked shared library x86_64

For this reason, I decided to install libpq separately from Homebrew:

brew install libpq

Then installing pg worked with this:

gem install pg -- --with-pq-dir=/opt/homebrew/opt/libpq/

(MacOS 11.6 Big Sur on MacBook Pro 13" 2020 with Apple M1 CPU)

Sanson answered 23/9, 2021 at 14:1 Comment(0)
B
3

I don't think you need the postgres development files, everything you need should have been included with your installer. It's more likely that the path they're installed to isn't in your environment path and therefore gem can't find them when it tries to compile pg.

You shouldn't have to run gem install pg as root, in fact if you do it's likely your PATH (root's PATH if run w/ sudo) won't contain the necessary info.

The following usually works for me:

# Might be different depending on where your installer installed postgres 8.3
export PATH=$PATH:/Library/PostgreSQL/8.3/include/
export ARCHFLAGS='-arch x86_64'
gem install pg
Before answered 10/6, 2011 at 15:56 Comment(3)
Running gem install pg (along with your two previous commands) instead of sudo gem install pg still gives the exact same results.Verdict
Are you on 32- or 64-bit architecture? Have you tried the above with the other architecture flag? Also did you change /Library/PostgreSQL/... to the correct location of wherever your copy of the postgres installation is?Before
Looked into my notes about doing the commands I listed. Looks like I installed Postgres via sudo port install postgresql83 postgresql83-server, similar to these instructions: flux88.com/2010/06/installing-postgresql-for-rails-on-mac-os-x. It seems the standalone installer is 32-bit, so you want to set your arch flags to 32-bit even if your machine is 64-bit. If you can't get it to work, I'd suggest uninstalling and reinstalling via MacPorts then attempting the instructions above. Hope that helps!Before
P
3

This is what finally did it for me (combination of multiple solutions provided before along with other posts):

$ sudo env ARCHFLAGS="-arch x86_64" gem install pg -- with-pg-include=/Library/PostgreSQL/9.6/include/

Prosecution answered 22/1, 2017 at 17:58 Comment(1)
The above solution worked for me in Mac OS High Sierra sudo env ARCHFLAGS="-arch x86_64" gem install pg -v '1.1.2' -- with-pg-include=/usr/local/Cellar/postgresql/10.5/include Locate the exact path for the include folder and update that accordingly.Curious
V
3

Well, I have tried all the solutions given above for

Can't find the PostgreSQL client library (libpq)

$ sudo su
$ env ARCHFLAGS="-arch x86_64" gem install pg

but nothing helped. For this reason, I decided to install libpq separately from Homebrew:

brew install libpq

then found a small catch though: libpq won't install itself in the /usr/local/bin directory for mac. To make that happen, you need to run:

brew link --force libpq

Which will symlink all the tools, not just libpq, into the /usr/local/bin directory. You're ready to run psql and start connecting now.

Valuate answered 1/4, 2022 at 6:12 Comment(0)
P
1

The ARCHFLAGS answer that others have proposed will not work if you somehow ended up with a 64-bit version of postgres (which homebrew will install) and a 32-bit version of ruby. For some reason rbenv insists on building ruby 1.9.2-p290 as 32-bit for me, which makes it impossible to link against 64-bit postgres.

Check the architecture of your ruby binary with

file `which ruby`

or if using rbenv

file `rbenv which ruby`

And compare against your postgres:

file `which postgres`

If there's a mis-match you'll need to re-install postgres or ruby. With rbenv I solved this just by switching to a different version: 1.9.3-p194 instead of 1.9.2-p290.

Plectron answered 26/4, 2012 at 15:41 Comment(0)
C
1

This is how I made it to work on Mavericks. Note: I already had installed postgresql 9.3 from homebrew.

  1. Update Xcode to 5.0 from App Store

  2. Install command line developer tools

    xcode-select --install

  3. Agree to Xcode license

    sudo xcodebuild -license

  4. Install gem

    ARCHFLAGS="-arch x86_64" gem install pg

Carboxylase answered 28/11, 2013 at 21:55 Comment(0)
T
1

So basically I did this ;-)

brew install postgres
Thayne answered 20/2, 2014 at 11:2 Comment(1)
Does brew install the libpq.so (dylib) as your answer implies?Rover
E
1

For my mac m1 after trying all of above solution and nothing working. I made it work by:

  • Install Homebrew x86

    • brew x86 will locate on: /usr/local/Homebrew/bin/brew
    • brew arm64 locate on: /opt/homebrew/bin/brew (my current brew)
  • Install libpq with arch x86 ( Since pg must be compiled with x86 libpq )

    arch --x86_64 /usr/local/Homebrew/bin/brew install libpq

  • Install gem pg

    gem install pg -v '0.18.2' -- --with-pq-dir=/usr/local/Cellar/libpq/14.2 --with-pg-config=/usr/local/Cellar/libpq/14.2/bin/pg_config

Egidius answered 3/3, 2022 at 11:49 Comment(0)
F
0

I'm probably a bit late to the party here, but in my case I was using rbenv and upgrading to Ruby 2.2.3. I had to install Bundler to get mine to work, I had an old system version.

gem install bundler

Fussy answered 2/12, 2015 at 5:21 Comment(0)
M
0

As mentioned above this has to do with the fact of having two ruby archs on rbenv /usr/bin/ruby: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [i386:Mach-O executable i386] what i had to do was simply install pg gem forcing x86_64 arch to be used with this command:

sudo env ARCHFLAGS="-arch x86_64" gem install pg

Remember to have your bash_profile up to date

Add the path of your postgres, in this case im using Postgres app (OSX) instead of brew (https://postgresapp.com/) by default this is the location:

export PATH=/Applications/Postgres.app/Contents/Versions/10/bin:$PATH

Reload bash with

sudo vi ~/.bash_profile

After doing this i was able to finally successfully install pg gem

Hope this helps!

Morelli answered 28/6, 2018 at 20:59 Comment(0)
S
0

On Mac you can try this (works for me): gem install pg -- with-pg-include=/Library/PostgreSQL/9.5/include Fetching: pg-1.0.0.gem (100%) Building native extensions with: 'with-pg-include=/Library/PostgreSQL/9.5/include' This could take a while... Successfully installed pg-1.0.0 Parsing documentation for pg-1.0.0 Installing ri documentation for pg-1.0.0 Done installing documentation for pg after 3 seconds 1 gem installed

(this part "/Library/PostgreSQL/9.5/include" you must put your Postgres path)

Seaside answered 24/7, 2018 at 0:45 Comment(0)
G
0

For those of you that tried the top answers and they didn't quite work, I thought I'd explain my situation and how it was fixed.

I was trying to use postgres for a Ruby project, using bundle install (and with a gem 'pg' in my gemfile), but I already had Postgres installed before, probably by using npm install pg or something like that.

I had an existing database, with data, and I was concerned that if I ran brew install postgres then it would wipe my existing data and tables.

It didn't! brew install postgres worked perfectly as suggested by @Jackie Chan

If you want to put your mind at ease though, you can back up your data as described at this link https://www.tecmint.com/backup-and-restore-postgresql-database/ e.g.

cd desktop
pg_dump -U your_db_user your_database_name >> file_containing_backup.sql
Gentilism answered 14/9, 2021 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.