PostgreSQL installed from source, no pg_config alias

1

1

So I installed pgsql 9.0.10 on Ubuntu 12.10 from source (./configure, make, make install). It all went well, created /usr/local/pgsql/ and everything that it should contain, but I have encountered one issue, it has not created the aliases or whatever they might be.

Now, I do have every and each of the executables but I am lacking the "shortcuts" in the shell.

Edit: I tried adding symbolic links to /bin folder, but it didn't do the trick. Also, aliases won't work because of the variable that I have to input.

output of ls -l /usr/local/pgsql/bin

total 7468
-rwxr-xr-x 1 root root   57741 Apr  1 22:48 clusterdb
-rwxr-xr-x 1 root root   57702 Apr  1 22:48 createdb
-rwxr-xr-x 1 root root   61978 Apr  1 22:48 createlang
-rwxr-xr-x 1 root root   58056 Apr  1 22:48 createuser
-rwxr-xr-x 1 root root   53368 Apr  1 22:48 dropdb
-rwxr-xr-x 1 root root   62095 Apr  1 22:48 droplang
-rwxr-xr-x 1 root root   53370 Apr  1 22:48 dropuser
-rwxr-xr-x 1 root root  682769 Apr  1 22:48 ecpg
-rwxr-xr-x 1 root root   75352 Apr  1 22:48 initdb
-rw-r--r-- 1 root root      89 Apr  1 23:07 links.sh
-rwxr-xr-x 1 root root   29741 Apr  1 22:48 pg_config
-rwxr-xr-x 1 root root   29055 Apr  1 22:48 pg_controldata
-rwxr-xr-x 1 root root   39982 Apr  1 22:48 pg_ctl
-rwxr-xr-x 1 root root  298999 Apr  1 22:48 pg_dump
-rwxr-xr-x 1 root root   75237 Apr  1 22:48 pg_dumpall
-rwxr-xr-x 1 root root   33913 Apr  1 22:48 pg_resetxlog
-rwxr-xr-x 1 root root  134674 Apr  1 22:48 pg_restore
-rwxr-xr-x 1 root root 5298811 Apr  1 22:48 postgres
lrwxrwxrwx 1 root root       8 Apr  1 22:48 postmaster -> postgres
-rwxr-xr-x 1 root root  396164 Apr  1 22:48 psql
-rwxr-xr-x 1 root root   57773 Apr  1 22:48 reindexdb
-rwxr-xr-x 1 root root   35484 Apr  1 22:48 vacuumdb

that's what happens when I try to run pg_config

$ pg_config
The program 'pg_config' can be found in the following packages:
 * libpq-dev
 * postgresql-common
 * postgres-xc-server-dev
Try: sudo apt-get install <selected package>

Ricard-Sole

Posted 2013-04-01T21:13:29.143

Reputation: 115

I don't fully understand what you mean by shell shortcuts. Is /usr/local/pgsql/bin actually in your PATH? How did you add the symbolic links? What's the output of ls -l /usr/local/pgsql/bin and file /usr/local/pgsql/bin/pg_config? – tink – 2013-04-01T21:50:41.787

@tink I mean I can't type pg_config in the terminal because it won't run pg_config, instead it'll tell me to install certain packages. – Ricard-Sole – 2013-04-01T22:18:19.170

Have you tried adding the install directory to your path? export PATH="${PATH}:/usr/local/pgsql/bin" – tink – 2013-04-01T22:49:06.230

Cool. Btw, why aren't you at least using 9.0.12 9f you HAVE to use such an old version of postgres? – tink – 2013-04-01T23:25:55.540

I just picked one, and since I'm just starting with SQL I figured it didn't really matter. Does it? – Ricard-Sole – 2013-04-02T08:38:34.660

Well ... in that case, why did you not just use "apt-get" to install any available postgres from your distro's repository? Oh, and if it's not too much hassle - feel free to accept my answer ;} – tink – 2013-04-02T17:17:32.457

Answers

0

If that comment above was all it took :)

Edit your ~/.bashrc, and add that line to it (towards the bottom of the file) to make it permanent.

export PATH="${PATH}:/usr/local/pgsql/bin" 

Or, to make it available for all users on your system, create a file e.g.

/etc/profile.d/pg_local.sh

with the export statement as content.

tink

Posted 2013-04-01T21:13:29.143

Reputation: 1 419