This section provides an overview of what postgresql is, and why a developer might want to use it.
It should also mention any large subjects within postgresql, and link out to the related topics. Since the Documentation for postgresql is new, you may need to create initial versions of those related topics.
pg_dumpall
and pg_dump
It's very important that if you use this, you call the pg_start_backup()
function before and pg_stop_backup()
function after. Doing filesystem backups is not safe otherwise; even a ZFS or FreeBSD snapshot of the filesystem backed up without those function calls will place the database in recovery mode and may lose transactions.
I would avoid doing filesystem backups instead of regular Postgres backups, both for this reason, and because Postgres backup files (especially in the custom format) are extremely versatile in supporting alternate restores. Since they're single files, they're also less hassle to manage.
PL/pgSQL is PostgreSQL's built-in programming language for writing functions which run within the database itself, known as stored procedures in other databases. It extends SQL with loops, conditionals, and return types. Though its syntax may be strange to many developers it is much faster than anything running on the application server because the overhead of connecting to the database is eliminated, which is particularly useful when you would otherwise need to execute a query, wait for the result, and submit another query.
Though many other procedural languages exist for PostgreSQL, such as PL/Python, PL/Perl, and PLV8, PL/pgSQL is a common starting point for developers who want to write their first PostgreSQL function because its syntax builds on SQL. It is also similar to PL/SQL, Oracle's native procedural language, so any developer familiar with PL/SQL will find the language familiar, and any developer who intends to develop Oracle applications in the future but wants to start with a free database can transition from PL/pgSQL to PL/SQL with relative ease.
It should be emphasized that other procedural languages exist and PL/pgSQL is not necessarily superior to them in any way, including speed, but examples in PL/pgSQL can serve as a common reference point for other languages used for writing PostgreSQL functions. PL/pgSQL has the most tutorials and books of all the PLs and can be a springboard to learning the languages with less documentation.
Here are links to some free guides and books on PL/pgSQL:
An explanation as to why you would want to use inheritance in PostgreSQL is available here: http://stackoverflow.com/a/3075248/653378
Please use below link for complete overview of:
To avoid cluttering the backup tool because the backup of old files is supposed to be done.
To enable this feature please uncomment line N° 3.
rm -R / save_db / *
The following command is used to edit the cron table for the current user.
crontab -e
Schedule the launch of the script with the calendar at 11pm.
0 23 * * * /saveProdDb.sh
Full syntax see: http://www.postgresql.org/docs/current/static/sql-comment.html
Please use below link for complete overview of Event Triggers in PostgreSQL
https://www.postgresql.org/docs/9.3/static/event-trigger-definition.html
JDBC URL
The JDBC URL can take one of these forms:
jdbc:postgresql://host[:port]/[database][parameters]
host
defaults to localhost
, port
to 5432.
If host
is an IPv6 address, it must be enclosed in square brackets.
The default database name is the same as the name of the connecting user.
To implement failover, it is possible to have several host[:port]
entries separated by a comma.
They are tried in turn until a connection succeeds.
jdbc:postgresql:database[parameters]
jdbc:postgresql:/[parameters]
These forms are for connections to localhost
.
parameters
is a list of key[=value]
pairs, headed by ?
and separated by &
. If the value
is missing, it is assumed to be true
.
An example:
jdbc:postgresql://localhost/test?user=fred&password=secret&ssl&sslfactory=org.postgresql.ssl.NonValidatingFactory
References