On 07/22/2010 09:02 PM, Andy Colson wrote:
On 07/22/2010 04:03 PM, Gary Fu wrote:
Hi,
System information:
- psql 8.4.4 on a client with CentOS 5.5 (64 bits)
- postgres 8.4.4 on the server with CentOS 5.5 (64 bits)
- the client is connected with vpn
I have a script to create a table with some comments in front. When I
use the command 'psql -f script.sql' to load it, it hangs. However, if
I remove the comments, OR remove some of the columns from the table,
it works okay. It looks like to me, the psql will hang with large size
of the script file. I tried 'psql < script.sql' and 'cat script.sql |
psql' with the same result.
However, I tried it on another client host (CentOS 5.5 32 bits), I
don't see this problem.
Any idea and suggestion ?
Thanks,
Gary
Line endings?
How about a sample?
What comment style: -- /* (* # ; ' //
-Andy
Below is an example that I created. It works okay, but when I add any
character in the comment or in the table definition, it fails (hangs).
I checked the server process (with ps command), and I can see that
connection is 'idle'. By the way, the size 1484 may not mean anything,
since I tried another case (with different comment and table) and the
problem still happens but the size 1484 is not the break point.
I think this may be CentOS(64 bits)/ssh related, since I don't have the
problem with CentOS(32 bits) and we have the same application to install
the tables with the same command on mandriva.
Thanks,
Gary
Sample file:
/*
=head1 NAME
ProblemFiles
=head1 DESCRIPTION
The ProblemFiles table is used to store the file names that have
problem to be handled by PollAndArchive and VerifyFiles programs.
=head1 FIELDS
ProblemId - The Id for the problem file
FileName - The full file name with problem
Reason - The reason for the file to be inserted
IsDN - This FileName is a DN (DDR or DS) file
DNFile - The DN file for the FileName in problem
DNType - The DN type (1 for DDR, 2 for DS, 0 for Unknown)
FtpPath - The ftp incoming path for the problem file, so we know
where to get
the file again if necessary
Adhoc - None for sd3e normal subscription,
SD3E for sd3e adhoc (handled as subscription)
Land/Ocean/Atmosphere/Ozone/Sounder/NICSE for peates' ad-hoc
CkSum - Th checksum of the file (only for file with DDR file on Reason :
Missing, Duplicate, so that they can be verified again if
necessary
test test test tt
=cut
*/
--
-- Name: ProblemFiles Type: Table
--
create table ProblemFiles
(
ProblemId serial primary key,
FileName varchar(256) not null,
Reason varchar(16) not null,
IsDN int not null default 0,
DNFile varchar(256) null,
DNType int not null default 1,
InsertTime timestamp not null default now()
);
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general