Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where to install postgres admin pack

Tags:

postgresql

I'm using this tutorial https://library.linode.com/databases/postgresql/ubuntu-12.04-precise-pangolin#sph_installing-postgresql on Linode to install the postgres admin pack. It says to get the postgres user and then

su - postgres
psql template1 < /usr/share/postgresql/9.1/contrib/adminpack.sql

su - postgres didn't work for me, but I logged in with sudo sudo -i -u postgres and when I tried to run the next command

psql template1 < /usr/share/postgresql/9.1/contrib/adminpack.sql

it said no such file or directory. Therefore I did

ls -la

to find out what directories and files exist and got this output, but I'm not sure how to install the admin pack from here. Can you explain? Thanks in advance

total 16
drwxr-xr-x  3 postgres postgres 4096 Jun 28 18:33 .
drwxr-xr-x 30 root     root     4096 Jun 28 18:31 ..
drwxr-xr-x  3 postgres postgres 4096 Jun 28 18:32 9.1
-rw-------  1 postgres postgres  194 Jul  2 03:04 .psql_history
like image 933
Leahcim Avatar asked Apr 18 '26 13:04

Leahcim


1 Answers

Don't send the sql file to the db. Instead, simply:

CREATE EXTENSION adminpack;

It will run the sql file for you and track the objects so they can all be dropped together if needed.

like image 167
Chris Travers Avatar answered Apr 20 '26 15:04

Chris Travers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!