pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
connection timeout?
3+ messages / 3 participants
[nested] [flat]

* connection timeout?
@ 1999-02-13 01:03 pierre@desertmoon.com
  1999-02-13 14:55 ` Re: [SQL] connection timeout? Sascha Schumann <sas@schell.de>
  0 siblings, 1 reply; 3+ messages in thread

From: pierre@desertmoon.com @ 1999-02-13 01:03 UTC (permalink / raw)
  To: pgsql-sql

All,
  

    Is there a connection timeout on the client code? That is if I were
    to leave the client running but idle for a period of time I'd like
    the client to time out and quit....is there anything like that
    in PostgreSQL, can it be added?

    -=pierre



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

* Re: [SQL] connection timeout?
  1999-02-13 01:03 connection timeout? pierre@desertmoon.com
@ 1999-02-13 14:55 ` Sascha Schumann <sas@schell.de>
  0 siblings, 0 replies; 3+ messages in thread

From: Sascha Schumann @ 1999-02-13 14:55 UTC (permalink / raw)
  To: pierre@desertmoon.com; +Cc: pgsql-sql

On Fri, Feb 12, 1999 at 06:03:42PM -0700, pierre@desertmoon.com wrote:
> All,
>   
> 
>     Is there a connection timeout on the client code? That is if I were
>     to leave the client running but idle for a period of time I'd like
>     the client to time out and quit....is there anything like that
>     in PostgreSQL, can it be added?
> 
>     -=pierre

I've employed the following method in one program (it's a CGI which may stay
longer around without using the database connection):

-----
PGconn *conn;

void sig_alrm(int nr)
{
	signal(SIGALRM, SIG_DEF);
	if(conn)
		PQfinish(conn);
	conn = NULL;
}

void use_pgsql(void)
{
	if(!conn) {
		conn = PQconnectdb(...);
		signal(SIGALRM, sig_alrm);
	}
	alarm(60);
}
-----

Before you use any database action now, you call use_pgsql() which will start
the counter and set up the connection.

-- 
                     
          Regards,
						                                
                            Sascha Schumann | 
                                 Consultant | finger sas@schell.de
                                            | for PGP public key



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

* RE: [SQL] connection timeout?
@ 1999-02-14 16:29 Kim Markle <KMarkle@IMNET.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Kim Markle @ 1999-02-14 16:29 UTC (permalink / raw)
  To: pgsql-sql

Pierre,

Most SQL clients will not timeout as far I know and rightfully so.  The
way I handle this is in the client application as an "Auto Logoff"
feature by implementing a timer with no activity and then log the
application out gracefully.

Kim Markle

> -----Original Message-----
> From:	pierre@desertmoon.com [SMTP:pierre@desertmoon.com]
> Sent:	Friday, February 12, 1999 8:04 PM
> To:	pgsql-sql@postgreSQL.org
> Subject:	[SQL] connection timeout?
> 
> All,
>   
> 
>     Is there a connection timeout on the client code? That is if I
> were
>     to leave the client running but idle for a period of time I'd like
>     the client to time out and quit....is there anything like that
>     in PostgreSQL, can it be added?
> 
>     -=pierre



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


end of thread, other threads:[~1999-02-14 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-02-13 01:03 connection timeout? pierre@desertmoon.com
1999-02-13 14:55 ` Sascha Schumann <sas@schell.de>
1999-02-14 16:29 RE: [SQL] connection timeout? Kim Markle <KMarkle@IMNET.com>

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