Re: psql problem

From: "shakahshakah(at)gmail(dot)com" <shakahshakah(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: psql problem
Date: 2010-07-22 22:14:20
Message-ID: c6a3c955-a22f-4e34-aa5a-a9ce41c4e071@i31g2000yqm.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Jul 22, 5:03 pm, Gary Fu <gary(dot)(dot)(dot)(at)sigmaspace(dot)com> 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

Are you sure it is hanging? Maybe piping into psql via "pv" (http://
www.ivarch.com/programs/pv.shtml) could give some insight as to where
it might be hanging, or if it is just going slowly, or whatever.

E.g., if your script is 240500 bytes long, the following will give a
simple progress meter, elapsed time, and ETA display:
cat yourscript.file | pv -t -r -e -b -s 240500 | psql

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2010-07-22 22:37:54 Re: Bitmask trickiness
Previous Message Andy Colson 2010-07-22 21:56:24 Re: optimizing daily data storage in Pg