Hello.
When I carried out SQL sentence in PostgreSQL7.3.8 environment,
PostgreSQL outputs the following error messages.
==
Dec 19 13:50:32 gyomu01 postgres[807]: [11] LOG: pq_flush: send() failed:
Broken pipe
Dec 19 13:50:33 gyomu01 postgres[807]: [12] LOG: pq_recvbuf: unexpected EOF on
client connection
==
Why these messages appear?
Please teach me about a workaround of a problem.
Work procedures are as follows.
(1) I install PostgreSQL7.3.8 in a HP-UX machine
(2) I carry out initdb to create gyomuDB
(3) I carry out an SQL sentence to make TABLE and FUNCTION in gyomuDB
% psql -d gyomuDB -f 003.sql
In 003.sql, I create various tables and indexes, but the following SQL
sentences terminated abnormally.
(There are 1500 lines in the whole file, and it is the extract as follows.)
###
CREATE FUNCTION mon_CreateTable_WbemMonitorLog( text ) RETURNS integerAS'
DECLARE
str_basenameALIAS FOR $1;
str_sql text;
str_tablename text;
nb integer;
nb_end integer;
BEGIN
nb := 0;
nb_end := 999;
while nb = nb_end loop
-- table
str_tablename := str_basename || CAST( nb AS text );
str_sql := ''CREATE TABLE '' || str_tablename
|| ''(''
|| ''MonID int NOT NULL ,''
|| ''CategoryID int NOT NULL ,''
|| ''ExtensionID int NOT NULL ,''
|| ''SummaryID int NOT NULL ,''
|| ''KeyValue varchar (256) NULL ,''
|| ''Data varchar (512) NULL ,''
|| ''GetDate timestamp NOT NULL ,''
|| ''Status int NOT NULL ,''
|| ''Summarized int NOT NULL);'';
execute str_sql;
nb := nb + 1;
end loop;
RETURN ( 0 );
END;
'
LANGUAGE 'plpgsql';
SELECT mon_CreateTable_WbemMonitorLog( 'WbemMonitorLogMinute_' );
SELECT mon_CreateTable_WbemMonitorLog( 'WbemMonitorLogHour_' );
SELECT mon_CreateTable_WbemMonitorLog( 'WbemMonitorLogDay_' );
DROP FUNCTION mon_CreateTable_WbemMonitorLog( text );
###
This function worked with various servers normally.
But this function terminated abnormally only with a certain server.
A difference is only that server that this function terminates abnormally with
has high-speed multiprocessor.
Besides this, there is not remarkable difference.
When this function worked normally, this function outputs as follows.
###
CREATE FUNCTION
mon_createtable_wbemmonitorlog
0
(1 row)
mon_createtable_wbemmonitorlog
0
(1 row)
mon_createtable_wbemmonitorlog
0
(1 row)
DROP FUNCTION
###
When this function terminated abnormally, psql outputs only CREATE FUNCTION.
And psql command terminated.
In other words I suppose that I fall in practice (SELECT) of the first function.
I checked the disk use situation then, the neck in a resource was not found.
I understand this error isn't caused by stringency of a resource.
In addition, this error caused when I am creating DB
just after PostgreSQL installation.
I can't think that there is a lot access in PostgreSQL.
I can't think that DB size is big and lacked memory.
About a signal
I carry out the above (3) via a script written in bash.
The script was finished by signal 16 then(SIGUSR1).
# ./gyomuDB_setup.com
Signal 16
I saw a source of PostgreSQL and various documents.
And I understood about a SIGUSR1 signal as follows.
* A SIGUSR1 signal is used only for timing making a transaction log
to restore DB at the time of DB disorder outbreak.
* All the transaction processing is carried out by the child process that is a
backend.
But when accumulated a fixed quantity transaction log,
postmaster carries out checkpoint processing
by transmitting a SIGUSR1 signal to postmaster from a backend.
(Actually, postmaster generates child process more and carries it out)
Actually this signal is transmitted not to postmaster but to psql, and psql
seems to stop.
postgresql.conf
--
#
# Connection Parameters
#
#tcpip_socket = false
#ssl = false
#max_connections = 32
#superuser_reserved_connections = 2
#port = 5432
#hostname_lookup = false
#show_source_port = false
#unix_socket_directory = ''
#unix_socket_group = ''
#unix_socket_permissions = 0777 # octal
#virtual_host = ''
#krb_server_keyfile = ''
#
# Shared Memory Size
#
#shared_buffers = 64# min max_connections*2 or 16, 8KB each
#max_fsm_relations = 1000 # min 10, fsm is free space map, ~40 bytes