0

I have blindly followed this tutorial for installing PostgreSQL and Apache AGE and would like to understand more about the process better. In the video, he has used a lot of options and flags for the ./configure command which I have copied below:

./configure --prefix=$(pwd) --enable-cassert --enable-debug CFLAGS="-glldb -ggdb -0g -g3 -fno-omit-frame-pointer"

  • He has mentioned --prefix=$(pwd) is required for setting a custom location as he has multiple of Postgres instances intalled. Does this mean without doing this, Postgres will be installed to the same location every time? If so, where will it be installed? I am unable to find it in any of my system files, unlike when I have installed Postgres using the packages and installers, which showed up in my /libraries directory.

  • --enable-cassert and --enable-debug are used to enable dev tools for debugging but it is not clear to me the differences between them.

  • As for the CFLAGS, I have no idea what is going on.

Thank you in advance.

Ken W.
  • 397
  • 1
  • 13

1 Answers1

3

Most of the answers to your questions can be found on the official documentation for Postgres. I've linked it below, but I'll also focus on the points you mentioned.

https://www.postgresql.org/docs/current/install-procedure.html#CONFIGURE-OPTIONS

--prefix=$(pwd) --enable-cassert --enable-debug

All the above are configuration parameters that postgres itself uses. Taken directly from the documentation, here is what they mean:

--prefix=PREFIX

Install all files under the directory PREFIX instead of /usr/local/pgsql. The actual files will be installed into various subdirectories; no files will ever be installed directly into the PREFIX directory.

--enable-debug

Compiles all programs and libraries with debugging symbols. This means that you can run the programs in a debugger to analyze problems. This enlarges the size of the installed executables considerably, and on non-GCC compilers it usually also disables compiler optimization, causing slowdowns. However, having the symbols available is extremely helpful for dealing with any problems that might arise. Currently, this option is recommended for production installations only if you use GCC. But you should always have it on if you are doing development work or running a beta version.

--enable-cassert

Enables assertion checks in the server, which test for many “cannot happen” conditions. This is invaluable for code development purposes, but the tests can slow down the server significantly. Also, having the tests turned on won't necessarily enhance the stability of your server! The assertion checks are not categorized for severity, and so what might be a relatively harmless bug will still lead to server restarts if it triggers an assertion failure. This option is not recommended for production use, but you should have it on for development work or when running a beta version.

CFLAGS="-glldb -ggdb -0g -g3 -fno-omit-frame-pointer"

As for the above, these are options you can set for the C compiler itself, not postgres. You can look them up individually for more info, but to give you an idea, -0g is a compiler flag that decides the level of code optimization performed by the compiler. Here's a link containing more info:

https://wiki.gentoo.org/wiki/GCC_optimization/en#-O

moeed865
  • 304
  • 1
  • 6