age icon indicating copy to clipboard operation
age copied to clipboard

Install the PostgreSQL (11.5 & 12.10) development source code into your development environment.

Open jrgemignani opened this issue 1 year ago • 26 comments

Install the PostgreSQL (11.5 & 12.10) development source code into your development environment. You will not be installing it to automatically run under root at system start up. Rather, you will be installing it such that you can bring it up (and down) locally under a regular development account.

jrgemignani avatar Sep 12 '22 22:09 jrgemignani

Installed PostgreSQL under a directory on my Linux VM.

PragyanD avatar Sep 12 '22 23:09 PragyanD

I have PostgreSQL 11.17 installed. Is that fine? Or should I remove it and Install 11.5? Is it okay if both installed pg versions are under the folder /usr/lib/postgresql ?

skkk98 avatar Sep 12 '22 23:09 skkk98

You can have multiple development versions of PG installed in your development directories. However, don't install them to run under root or under the system. You want to be able to bring them up and down under your development account.

jrgemignani avatar Sep 13 '22 00:09 jrgemignani

Is it okay to have PG 11.17 and 12.12 instead of 11.5 and 12.10? I couldn't find any way of installing specific "minor" versions of PG.

susano0 avatar Sep 13 '22 20:09 susano0

You will need to download the PostgreSQL "source" and build it in your development environment. Go to the following link and on the left you'll see Source, under Downloads -

https://www.postgresql.org/download/

Btw, this also means that you will need to have gcc and gdb installed.

jrgemignani avatar Sep 13 '22 21:09 jrgemignani

Getting error while running make install with PG 12.10

Image

susano0 avatar Sep 14 '22 06:09 susano0

I don't know if these issues cause that error.

  • You shouldn't be using sudo for any of this.
  • You will need to download the source code for PG 11.5 & 12.10 and create directories for each PG version, under a development account. Not a root account. Root isn't necessary for any of this.
  • You will need to follow the build instructions - which means using 'configure' - to build that PG version. See PG's INSTALL readme.
  • You will need to then build the AGE extension into each specific version of PG.

jrgemignani avatar Sep 14 '22 17:09 jrgemignani

PG 11.5 and PG12.10 installations were successful in 2 separate directories (tested them as well). When I build the AGE extension with PG12, it throws this error (ag_graph.c -> insert_graph(args) -> error: void value not ignored), although with PG11 I was able to build and run the regression tests successfully.

susano0 avatar Sep 14 '22 18:09 susano0

Are you building the correct AGE branch for PG12?

jrgemignani avatar Sep 14 '22 18:09 jrgemignani

Yes, I used "AGE PG12.1.0 ALPHA" for PG12.

susano0 avatar Sep 14 '22 18:09 susano0

Do we need PG12.10 or PG12.1 (inferring from the title of the branch)? I will try with PG12.1.

Edit: Did not work with PG12.1 as well. Getting the same error.

susano0 avatar Sep 14 '22 18:09 susano0

Is that the only error? What OS?

jrgemignani avatar Sep 14 '22 19:09 jrgemignani

Actually, that error shows that you aren't actually building the extension from the AGE ALPHA PG12 release.

jrgemignani avatar Sep 14 '22 19:09 jrgemignani

Actually, that error shows that you aren't actually building the extension from the AGE ALPHA PG12 release.

jrgemignani avatar Sep 14 '22 19:09 jrgemignani

I am using Ubuntu 22.04 LTS.

susano0 avatar Sep 14 '22 20:09 susano0

Thank you. You were right, resolved. :)

susano0 avatar Sep 14 '22 20:09 susano0

Where should these pg installations be? I created a folder(pgsql11) under documents and installed(make --prefix install) it in this created folder. But it doesn't seem to work. Should it be under /usr/local/ or something?

skkk98 avatar Sep 14 '22 23:09 skkk98

Mine are under my development home directory, as an example.

jrgemignani avatar Sep 14 '22 23:09 jrgemignani

I currently have it in home/usr/pgsql-11.5, but when I change the usr(su - postgres) to test psql, I cannot find this. So should I move this installations inside the root(somewhere like /usr)

skkk98 avatar Sep 14 '22 23:09 skkk98

I keep getting this error that postgres is not in sudoers file. This incident will be reported. Any idea what to do?

Image

skkk98 avatar Sep 15 '22 03:09 skkk98

I tried installing again everything from start. Now I am getting this error, Don't know what to do.

Image

skkk98 avatar Sep 15 '22 18:09 skkk98

There is no need to install or run PostgreSQL under root, so no need to have it in the sudoers file. You should -

  1. Make sure that you have gcc and gdb installed on your system.
  2. Do not use root or sudo for any of the following parts.
  3. Download the PG source code for the 11.5 & 12.10 versions of PostgreSQL to some directory.
  4. Extract the PG sources into their own directories under your development account.
  5. Follow the instructions (INSTALL) on how to configure, build, and install the source into each of their respective directories. Don't forget to use the debug flags or gdb won't be helpful for any debugging you might end up doing.
  6. Again, you will be configuring, building, and installing that specific version of PG into its own directory, which could be under the directory that contains the source for that version. This is how I do it for mine.
  7. You will need to run the PG executables located in the bin directories for those installations for those PG version.

I'm purposely being minimally helpful as this approach will be helpful later on. I don't expect anyone to get it perfect right away.

jrgemignani avatar Sep 15 '22 18:09 jrgemignani

I have updated the above comment to make it more helpful.

Additionally, all 3 of you are encouraged to help each other out.

jrgemignani avatar Sep 16 '22 16:09 jrgemignani

Completed Installation and also tested pg 11.5 and 12.10.

skkk98 avatar Sep 20 '22 08:09 skkk98

install completed pg 11.5 and 12.10

marodins avatar Sep 26 '22 07:09 marodins

Installed pg 11.5 and 12.10.

rafsun42 avatar Sep 27 '22 04:09 rafsun42