pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
asynchronous psql command options?
7+ messages / 4 participants
[nested] [flat]

* asynchronous psql command options?
@ 2003-01-16 17:31 Christopher Smith <christopherl_smith@yahoo.com>
  2003-01-16 18:06 ` Re: asynchronous psql command options? Bjoern Metzdorf <bm@turtle-entertainment.de>
  2003-01-16 18:56 ` Re: asynchronous psql command options? Tom Lane <tgl@sss.pgh.pa.us>
  2003-01-16 21:23 ` Re: asynchronous psql command options? Sean Chittenden <sean@chittenden.org>
  0 siblings, 3 replies; 7+ messages in thread

From: Christopher Smith @ 2003-01-16 17:31 UTC (permalink / raw)
  To: pgsql-admin


recently, my dsl provider went out of business, currently, I am using dial-up and I need to build indexes of a very large database table.  this take a few hours...

i used psql via ssh on dial-up and closed the ssh client. I logged in again and it showed that the postmater process was still running.. I thought that the index building process would continue 'til completion.

however, this morning no indexes were built.  Is it possible to send commands via psql asynchronous.  Does anyone know why the index building process stopped?

please advise,

thanks



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: asynchronous psql command options?
  2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
@ 2003-01-16 18:06 ` Bjoern Metzdorf <bm@turtle-entertainment.de>
  2 siblings, 0 replies; 7+ messages in thread

From: Bjoern Metzdorf @ 2003-01-16 18:06 UTC (permalink / raw)
  To: Christopher Smith <christopherl_smith@yahoo.com>; pgsql-admin

> i used psql via ssh on dial-up and closed the ssh client. I logged in
again and it showed that the postmater process was still running.. I thought
that the index building process would continue 'til completion.

try

( echo '´CREATE INDEX blablabla' | psql database >> log.txt ) &

on your (bash) shell. You should be able to log out safely then and have the
output in log.txt.

Regards,
Bjoern




^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: asynchronous psql command options?
  2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
@ 2003-01-16 18:56 ` Tom Lane <tgl@sss.pgh.pa.us>
  2003-01-16 19:23   ` Re: asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
  2003-01-16 19:46   ` Re: asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
  2 siblings, 2 replies; 7+ messages in thread

From: Tom Lane @ 2003-01-16 18:56 UTC (permalink / raw)
  To: Christopher Smith <christopherl_smith@yahoo.com>; +Cc: pgsql-admin

Christopher Smith <christopherl_smith@yahoo.com> writes:
> i used psql via ssh on dial-up and closed the ssh client. I logged in
> again and it showed that the postmater process was still running.. I
> thought that the index building process would continue 'til
> completion.

> however, this morning no indexes were built.  Is it possible to send
> commands via psql asynchronous.  Does anyone know why the index
> building process stopped?

It worked for me in a quick test here: issue CREATE INDEX command,
"kill -9" the psql client from another window, wait for indexing to
finish.

I wonder whether you had started a transaction block, viz
	begin;
	create index ...;
	<<kill client>>
Without a commit to match the begin, the index would be discarded.

Another likely prospect is that the CREATE INDEX command actually failed
(ran out of disk space, for example).  Did you look in the postmaster
log to see if any error message was recorded?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: asynchronous psql command options?
  2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
  2003-01-16 18:56 ` Re: asynchronous psql command options? Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-01-16 19:23   ` Christopher Smith <christopherl_smith@yahoo.com>
  1 sibling, 0 replies; 7+ messages in thread

From: Christopher Smith @ 2003-01-16 19:23 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin


Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb1              17G  2.0G   13G  13% /var/lib/pgsql/data
/dev/sdd1              17G   11G  5.2G  68% /datadir

correct disk space ran out.  However, just one more question... on my test server the indexes are ~8G.   I moved the data to be indexed (sym linkd ) to the datadir (as shown above). I thought that the indexes would be in my /var/lib/pgsql/data directory.

How can I get the indexes on a disk with necessary space. Please help!


 Tom Lane <tgl@sss.pgh.pa.us> wrote:Christopher Smith writes:
> i used psql via ssh on dial-up and closed the ssh client. I logged in
> again and it showed that the postmater process was still running.. I
> thought that the index building process would continue 'til
> completion.

> however, this morning no indexes were built. Is it possible to send
> commands via psql asynchronous. Does anyone know why the index
> building process stopped?

It worked for me in a quick test here: issue CREATE INDEX command,
"kill -9" the psql client from another window, wait for indexing to
finish.

I wonder whether you had started a transaction block, viz
begin;
create index ...;
<>
Without a commit to match the begin, the index would be discarded.

Another likely prospect is that the CREATE INDEX command actually failed
(ran out of disk space, for example). Did you look in the postmaster
log to see if any error message was recorded?

regards, tom lane


---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: asynchronous psql command options?
  2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
  2003-01-16 18:56 ` Re: asynchronous psql command options? Tom Lane <tgl@sss.pgh.pa.us>
@ 2003-01-16 19:46   ` Christopher Smith <christopherl_smith@yahoo.com>
  2003-01-16 21:19     ` Re: asynchronous psql command options? Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 1 reply; 7+ messages in thread

From: Christopher Smith @ 2003-01-16 19:46 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin


disk space ran out.  Is it possible to predict the filename to be used for indexes and hence create a link to another open disk.
I think that the filename used are oids?
please advise
 Tom Lane <tgl@sss.pgh.pa.us> wrote:Christopher Smith writes:
> i used psql via ssh on dial-up and closed the ssh client. I logged in
> again and it showed that the postmater process was still running.. I
> thought that the index building process would continue 'til
> completion.

> however, this morning no indexes were built. Is it possible to send
> commands via psql asynchronous. Does anyone know why the index
> building process stopped?

It worked for me in a quick test here: issue CREATE INDEX command,
"kill -9" the psql client from another window, wait for indexing to
finish.

I wonder whether you had started a transaction block, viz
begin;
create index ...;
<>
Without a commit to match the begin, the index would be discarded.

Another likely prospect is that the CREATE INDEX command actually failed
(ran out of disk space, for example). Did you look in the postmaster
log to see if any error message was recorded?

regards, tom lane


---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: asynchronous psql command options?
  2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
  2003-01-16 18:56 ` Re: asynchronous psql command options? Tom Lane <tgl@sss.pgh.pa.us>
  2003-01-16 19:46   ` Re: asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
@ 2003-01-16 21:19     ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2003-01-16 21:19 UTC (permalink / raw)
  To: Christopher Smith <christopherl_smith@yahoo.com>; +Cc: pgsql-admin

Christopher Smith <christopherl_smith@yahoo.com> writes:
> disk space ran out.  Is it possible to predict the filename to be used
> for indexes and hence create a link to another open disk.

No, but you might get some joy by adjusting the pgsql_tmp subdirectory
of your database to symlink to a temp directory on another disk.  The
peak disk usage during a CREATE INDEX is going to have about as much
temp space as finished-index space ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* Re: asynchronous psql command options?
  2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
@ 2003-01-16 21:23 ` Sean Chittenden <sean@chittenden.org>
  2 siblings, 0 replies; 7+ messages in thread

From: Sean Chittenden @ 2003-01-16 21:23 UTC (permalink / raw)
  To: Christopher Smith <christopherl_smith@yahoo.com>; +Cc: pgsql-admin

> recently, my dsl provider went out of business, currently, I am
> using dial-up and I need to build indexes of a very large database
> table.  this take a few hours...
> 
> i used psql via ssh on dial-up and closed the ssh client. I logged
> in again and it showed that the postmater process was still
> running.. I thought that the index building process would continue
> 'til completion.
> 
> however, this morning no indexes were built.  Is it possible to send
> commands via psql asynchronous.  Does anyone know why the index
> building process stopped?

If you use screen(1) and detach from it, then reattach to it at a
later date, there may be some diagnostic output sent to the screen.

# Start work
ssh....
screen -d -R -S psql
psql...
Ctrl-a d
exit

# Come back a few hours later:
ssh....
screen -d -R -S psql
[check to see if there's any output]
exit  # the screen session
exit  # exit ssh


-- 
Sean Chittenden



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2003-01-16 21:23 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-16 17:31 asynchronous psql command options? Christopher Smith <christopherl_smith@yahoo.com>
2003-01-16 18:06 ` Bjoern Metzdorf <bm@turtle-entertainment.de>
2003-01-16 18:56 ` Tom Lane <tgl@sss.pgh.pa.us>
2003-01-16 19:23   ` Christopher Smith <christopherl_smith@yahoo.com>
2003-01-16 19:46   ` Christopher Smith <christopherl_smith@yahoo.com>
2003-01-16 21:19     ` Tom Lane <tgl@sss.pgh.pa.us>
2003-01-16 21:23 ` Sean Chittenden <sean@chittenden.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox