use -R option in your psql -R separator
--record-separator separator Use separator as the record separator. This is equivalent to the \pset recordsep command.
---------- Post updated at 06:33 AM ---------- Previous update was at 06:30 AM ----------
Quote:
Originally Posted by jimmy_y
Hi Everyone,
When i finish running
i get the output
Would like to have the result like:
or can i use printf, sprintf, or awk, etc, to make the output like this? Please advice.
Segregated the problematic portion, and showing for your view here.,
1. Following is the function definition,
create or replace function new_del(id integer) returns void as $$
begin
raise info 'dollar :%',$1;
delete from testing where id=$1;
end ;
$$
language 'plpgsql';
... (1 Reply)
Hi All
I have what seems to be something quite trivial but for the life of me can't work out a solution.
Basically, I have the following script that reads a version report that contains certain flags. If a condition is true, I want to print the value of column 2, sort them uniquely and return... (2 Replies)
Hi,
I have installed cygwin on my windows XP system. And I am trying to use the following code snippet:
set SERVER="grep JDBCConnectionPool config.xml | gawk -F; '{print $2}'"
sed -i 's/%SERVER%/WLMDEVDB1/' config.xml
But it doesn't work because at runtime %SERVER% gets replaced by "grep... (2 Replies)
Well as the title describes, its a pretty straight forward problem. I have a series of psql tables where there are lots of blanks. However there is at least one column, called name, that will never be blank. I want to write a select statement to get all of the contents of the table and then turn... (3 Replies)
Hey All,
Quick question...
I'm writing a short script to check if a continuous port is running on a server.
I'm using "ps -ef | grep -v grep | grep processName" and I was wondering if it was better/more reliable to just check the
return code from the command or if its better to pipe to... (12 Replies)
Hi All,
There are 2 scripts A and B.
A --> It will invoke script B
B -->
It will generate below output.
100 - connected
105 - Not Connected
210 - Connected
I want to return this value to script A. Please advice. (4 Replies)
cmd()
{
echo " "
echo "$(whoami)@$(hostname):$(pwd)# $*"
results=`eval $*`
echo $results
}
I want to get the eval $* 's return value and pass it to a new variable $val, and get "eval $*" 's the ... (7 Replies)
Hello
Just edited the entry to make it easier to understand what i want
How can i achieve this: GOAL:
read 2 field from a table with PSQL
result of this PSQL command is this
INSTALLEDLANG=$(su - postgres -c "psql -A -t -q -c -d ${DBNAME} -t -c 'SELECT code, iso_code from res_lang'")
... (0 Replies)
Hi,
I have a shell script containing multiple PSQL queries for which I want the output to be redirected to a text file.
psql -U postgres -d database -o textfile.txt << EOF
Query1;
Query2;
Query ....;
EOF
When executing the script, queries outputs are directed to textfile.txt, however... (2 Replies)
Discussion started by: nms
2 Replies
LEARN ABOUT DEBIAN
ocf_heartbeat_pgsql
OCF_HEARTBEAT_PGSQL(7) OCF resource agents OCF_HEARTBEAT_PGSQL(7)NAME
ocf_heartbeat_pgsql - Manages a PostgreSQL database instance
SYNOPSIS
pgsql [start | stop | status | monitor | meta-data | validate-all]
DESCRIPTION
Resource script for PostgreSQL. It manages a PostgreSQL as an HA resource.
SUPPORTED PARAMETERS
pgctl
Path to pg_ctl command. (optional, string, default /usr/bin/pg_ctl)
start_opt
Start options (-o start_opt in pg_ctl). "-i -p 5432" for example. (optional, string, no default)
ctl_opt
Additional pg_ctl options (-w, -W etc..). (optional, string, no default)
psql
Path to psql command. (optional, string, default /usr/bin/psql)
pgdata
Path to PostgreSQL data directory. (optional, string, default /var/lib/pgsql/data)
pgdba
User that owns PostgreSQL. (optional, string, default postgres)
pghost
Hostname/IP address where PostgreSQL is listening (optional, string, no default)
pgport
Port where PostgreSQL is listening (optional, integer, default 5432)
monitor_user
PostgreSQL user that pgsql RA will user for monitor operations. If it's not set pgdba user will be used. (optional, string, no
default)
monitor_password
Password for monitor user. (optional, string, no default)
monitor_sql
SQL script that will be used for monitor operations. (optional, string, default select now();)
config
Path to the PostgreSQL configuration file for the instance (optional, integer, no default)
pgdb
Database that will be used for monitoring. (optional, string, default template1)
logfile
Path to PostgreSQL server log output file. (optional, string, default /dev/null)
socketdir
Unix socket directory for PostgeSQL (optional, string, no default)
stop_escalate
Number of shutdown retries (using -m fast) before resorting to -m immediate (optional, integer, no default)
SUPPORTED ACTIONS
This resource agent supports the following actions (operations):
start
Starts the resource. Suggested minimum timeout: 120.
stop
Stops the resource. Suggested minimum timeout: 120.
status
Performs a status check. Suggested minimum timeout: 60.
monitor
Performs a detailed status check. Suggested minimum timeout: 30. Suggested interval: 30.
meta-data
Retrieves resource agent metadata (internal use only). Suggested minimum timeout: 5.
validate-all
Performs a validation of the resource configuration. Suggested minimum timeout: 5.
methods
Suggested minimum timeout: 5.
EXAMPLE
The following is an example configuration for a pgsql resource using the crm(8) shell:
primitive p_pgsql ocf:heartbeat:pgsql
op monitor depth="0" timeout="30" interval="30"
SEE ALSO
http://www.linux-ha.org/wiki/pgsql_(resource_agent)
AUTHOR
Linux-HA contributors (see the resource agent source for information about individual authors)
resource-agents UNKNOWN 03/09/2014 OCF_HEARTBEAT_PGSQL(7)