PostgreSQL 9.3beta1 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3, 64-bitĪnd check the data directory: postgres=# show data_directory Īll configuration files are stored in the data directory: ~/postgres/data. Let’s also check the database version: postgres=# select version() To login to this database I use: ~/postgres/bin/psql -U szymon postgres The default database created in Postgres is postgres. The PostgreSQL installation uses my system username szymon as Postgres admin name. One important notice, you should use the psql program which you’ve already installed: ~/postgres/bin/psql -version LOG: database system is ready to accept connectionsĬonnect to the database. LOG: database system was shut down at 11:08:10 CEST Let’s run, I will use the first command, the log lines will be printed on console: /home/szymon/postgres/bin/postgres -D /home/szymon/postgres/data/ This shows you exact commands needed for running Postgres at this location with this database. Or /home/szymon/postgres/bin/pg_ctl -D /home/szymon/postgres/data/ -l logfile start home/szymon/postgres/bin/postgres -D /home/szymon/postgres/data/ You can now start the database server using: auth-local and -auth-host, the next time you run initdb. You can change this by editing pg_hba.conf or using the option -A, or WARNING: enabling "trust" authentication for local connections 128MBĬreating template1 database in /home/szymon/postgres/data/base/1. The default text search configuration will be set to "english".Ĭreating directory /home/szymon/postgres/data. The default database encoding has accordingly been set to "UTF8". The database cluster will be initialized with locale "en_US.UTF-8". This user must also own the server process. Your output should look like this: The files belonging to this database system will be owned by user "szymon". For this I need to use initdb program, but not this one installed at system level, but this one from ~/postgres/bin/ directory: ~/postgres/bin/initdb -D ~/postgres/data/ The data will be at ~/postgres/data directory. I’m going to keep the database in the same directory as the installed files. This should create four directories in ~/postgres/ * bin Installation copies all files into the directory from the –prefix parameter. If compilation ended without error, you can install the database. On my laptop compilation with 4 cores takes 1 minute 26 seconds. My computer has 4 cores, I want to use all of them, this way compilation time will be much shorter. The -j parameter allows for this maximum number of jobs at the same time. If configure succeeded, you can compile the sources. If you have any errors, most probably you don’t have some needed libraries installed. The configure command should finish without any errors. PYTHON parameter points to current python binary installation. The –with-python parameter enables compiling with plpython support. The –prefix parameter shows the path where Postgres will be installed. configure -prefix=$HOME/postgres/ -with-python PYTHON=/usr/bin/python2.7 Now you should enter the directory where your sources are and run below command for source configuration. If you are using different system, or different system/Postgres version, then your packages/libraries can be named differently. libpython2.7, libpython2.7-dev - for compiling with PL/Python support.zlib1g, zlib1g-dev - compression library used internally by Postgres.libreadline6, libreadline6-dev - readline support.I’m using Ubuntu, the packages I use for compiling Postgres are: The complete list can be found in Postgres documentation. Install Needed Softwareįor compiling Postgres you will need some libraries and programs. Unpack it somewhere, and you have the Postgres sources you need. I clone that, but you could just download zip file. I use GitHub for getting the latest sources. Download Sourcesįirst of all you need to download sources. The only way to install Postgres without root privileges, in home directory, is to compile it from sources. What’s more, this way you rather will not install the PostgreSQL beta version. Installation requires root privileges, on some machines programmers are not allowed to do that. However this way you just depend on the installation settings chosen by the packages mainainers. PostgreSQL can be installed using installers prepared for your operation system.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |