To install from the CentOS repositories, simply run:.
Alternatively, you can install the latest version from the Postgres repositories. As of this publication, PostgreSQL 9. Select the version you wish to install from the Postgres Yum repositories. Locate the CentOS 7 link for your chosen version and download it to your Linode:. When installing Postgres manually, you will have to specify the version:. Issue the following commands to set a password for the postgres database user.
Be sure to replace newpassword with a strong password and keep it in a secure place.
Note that this user is distinct from the postgres Linux user. The Linux user is used to access the database, and the PostgreSQL user is used to perform administrative tasks on the databases. The password set in this step will be used to connect to the database via the network. Peer authentication will be used by default for local connections. As the postgres Linux user, log in by running:. This will log you in as the postgres database user. You can create databases with the createdb command.
Create a sample database called mytestdb by running this command as the postgres Linux user:. For example, you could assign ownership to the examplerole role by running:. The createdb command has several additional options, which can be found in the PostgreSQL documentation. By default, you will connect to a database as your peer-authenticated user. You will receive output similar to this:.
You can delete, or drop , databases with the dropdb command. For example, to delete the mytestdb database created previously, issue this command as the postgres Linux user:. PostgreSQL databases use tables to store and organize information within a database. When creating your own tables, you may specify as many parameters columns as you need and name them appropriately.
For example, if you had two separate tables called employees1 and employees2 , you could delete them both by running:. Tables can be altered to add definitions, data types and columns. You can use queries to pull specific information from your database. PostgreSQL supports many querying options. PostgreSQL grants database access via roles , which are used to specify privileges. New user roles are added with the createuser command. To create a new user called examplerole , issue this command as the postgres Linux user:.
PostgreSQL Books, Database Books, SQL Books, and Programming Books
From the PostgreSQL shell, enter the following to grant all privileges on the table employees to the user examplerole :. These commands should be run as the postgres Linux user. Use the createuser command to create a new group role. The --no-login option is specified because groups do not need login capability. The createuser command has several other options.
See the PostgreSQL documentation for more details. Make sure nobody is using the database, then type in Terminal, as postgres user:. It is also what we know as an online backup, as the main database can stay in use while the command copies all the data. The base backup should take about as long as your normal backups take and progress is shown in the Terminal window. The scp command is used to copy the base backup to the same location on the hot standby server replace You could use a USB key or any other mechanism to transfer the file that you want.
This may also take a long time and progress is shown in the Terminal window. If a multi-core processor is available you may wish to consider using the pigz compression program instead to get a significant speed-up to the backup. Be aware that using pigz requires separate installation and it also uses a different extension than the bzip2 method:. The hot standby server should already be stopped. We need to use Terminal as the postgres user and remove the entire data directory - if it exists.
The expansion of the base backup database from the main server will also restore its postgresql. We now need to adjust them to ensure that they are set to be a hot standby database.
- PostgreSQL Database Download?
- Configuration and setup of the generator?
- Second Time Around?
- Create a geodatabase in PostgreSQL on Linux?
- POCO is Used For!
The settings below tell Postgres that it is the slave machine. Look for the 'archive' settings that were restored from the base backup and comment them out by putting a ' ' in front of the parameter. There should already be 3 lines that have replication in them from the main database.
If they are not uncommented, you will need to do so and set permissions to 'trust' and go back and verify the contents of the same file in the main database. Please confirm replication is working before doing the next step to clean up the temporary base backup files. The base backup file was created on both the main server and migrated to the hot standby machines. If you have a large database, this file could be sizeable itself and it is best to delete it. This should give a row back that says the server is 'streaming'.
You can repeat the query and the numbers will change, indicating that replication is proceeding. Data replicates from the main server to the Hot Standby immediately. If there is a change to the main database, it should appear in the hot standby immediately after that. After the tail command, you should see that the server entered standby mode and that is connecting to the main server.
Even after setting up the replication to the hot standby server, you should check this log periodically to make sure it continues to work. The example below shows the startup of the standby server after first being created or being stopped for a period of time. The log files are consumed and, finally, replication starts. Once replication starts, no further 'restore' messages will appear in the logs -- you can then use the pgAdmin query method to view the status of replication on the main server.
You can go to the replication folder and see that new files appear once a minute and old ones go away. It is probably okay because it was originally copied from the main server at time of making the standby. If your recovery. For more information refer to the postgres fail-over documentation. Download the latest Postgres installer from the ArtsMan web site. Once you have it, make sure you have done the following steps:.
Remember, do not attempt to try this unless you just made a backup of your database. If not, you may end up redoing the replication server. Always verify that replication is working properly after a postgres update.
Make sure to read the next step before starting the install to decide if you can do an easy install or the custom install. Follow these steps if you are using the TheatreManager TM PostGresSetup installer program and you may want to bookmark this page in your browser in case you want to refer to these installation steps.
There is no need for it.
If you wish join a domain controller, please leave the database server login window pointing to the local machine instead of the domain. It makes a user logging on for support and updates easier. Note that the machine should always be locked so sign in is required - per PCI compliance. Since access to the server is under very controlled access via port from the Theatre Manager application only, it should not be required.
If you must install virus software on the database machine, set it to scan the machine daily and void the Postgres DB files. The best defence against any virus software is a backup of the database off machine and, even better, off premises.
Install PostgreSQL (Windows): /Documentation
If a checkbox that implies "Protect My Computer" or "Run with Restrictions" is available and enabled, uncheck the box to allow the installer to run with full install privileges. If you say yes, postgres will install automatically for you and you can SKIP the next section describing how to install it manually and proceed to the step where the installer asks about installing a demo database.
Do not do this step if you elected to let the Theatre Manager Postgres installer automatically install Postgres for you. Only reference these instructions if you are running the actual Postgres installer from the Postgres web site manually. Accept all the defaults on the screens that follow except the last one that references 'stackbuilder'.