Use the IF-THEN-ELSIF instead of a simple IF-ELSE if you have to evaluate multiple conditions. In such a case, if the specified condition is true, the associated statement within that branch will be executed. If all the specified conditions are evaluated to FALSE, then the control will be...
-name pam_unix.so -delete# perform compression if it is necessaryARG COMPRESS RUNif["$COMPRESS"="true"];then\set-ex \# Allow certain sudo commands from postgres&&echo'postgres ALL=(ALL) NOPASSWD: /bin/tar xpJf /a.tar.xz -C /, /bin/rm /a.tar.xz, /bin/ln -snf dash /bin/sh'>...
CASE condition WHEN condition value THEN statement ELSE additional statement; Example We can use CASE to evaluate multiple conditions for a single variable, “job_id.” If “job_id” is “ACCOUNT,” the salary increase is 10%; if “job_id” is “IT_PROG,” the sal...
and then this prepared statement is EXECUTEd for each execution of the IF statement, with the current values of the PL/pgSQL variables supplied as parameter values. 4.Basic Statements In this section and the following ones, we describe all the statement types that are explicitly understood by P...
Consider Slim Installation if you only want essential components for HA PostgreSQL. Install with the pig cli curl -fsSL https://repo.pigsty.io/pig | bash curl -fsSL https://repo.pigsty.cc/pig | bash # mirror Then you can launch pigsty with pig sty sub command: pig sty init # install...
Multiple setup blocks are allowed if needed; each is run separately, in the given order. (The reason for allowing multiple setup blocks is that each block is run as a single PQexec submission, and some statements such as VACUUM cannot be combined with others in such a block.) teardown {...
pending or abort-pending, and then when the main loop reaches CommitTransactionCommand, the real work is done. The main point of doing things this way is that if we get an error while popping state stack entries, the remaining stack entries still show what we need to do to finish up. ...
if [ $1 = 0 ] ; then /sbin/service postgresql-9.1 condstop >/dev/null 2>&1 chkconfig --del postgresql-9.1 fi %postun server /sbin/ldconfig if [ $1 -ge 1 ]; then /sbin/service postgresql-9.1 condrestart >/dev/null 2>&1 fi %if %plperl %post -p /sbin/ldconfig plperl %...
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then echo never > /sys/kernel/mm/transparent_hugepage/enabled fi # 两个实例, 每个实例16G shared buffer。 #sysctl -w vm.nr_hugepages=17000 # 自启动两个实例。 su - postgres -c "pg_ctl start -...
If using PostgreSQL 9.4, then the pglogical_origin extension also has to be installed on that node: CREATE EXTENSION pglogical_origin; Now create the provider node: SELECT pglogical.create_node( node_name := 'provider1', dsn := 'host=providerhost port=5432 dbname=db' ); Add all tables...