Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

pgintcl connection handle

55 views
Skip to first unread message

anj patnaik

unread,
Oct 8, 2015, 1:19:50 PM10/8/15
to
Is there a way to increase the time the pgintcl connection handle stays valid? I tried to run pg_conninfo command which apparently works in Pgtcl but not in pgintcl. Is there a similar command to check the connections status/increase connection alive time?

I am referring to the output from:
pg_connect -conninfo postgresql://postgres:pass@myserver:5432/postgres

I noticed a case where the handle had become invalid and had to re-connect, but wanted to find out default behavior.

Thank you!

lj

unread,
Oct 8, 2015, 10:21:21 PM10/8/15
to
There is no timeout for the connection handle. It stays valid and
open until you close it, unless there is a problem with the network or
server. If you are connecting to a database over an unreliable network
connection, you may have to deal with this at the application level, by
implementing error recovery and reconnection.

I'm not aware of any implementation of pgtcl that has a "pg_conninfo" command.

(By the way, these are sort of off-topic for this newsgroup)

anj patnaik

unread,
Oct 12, 2015, 4:11:33 PM10/12/15
to
Ok thanks. Is there a better forum to discuss pgintcl?

Is there a limit on the size of the text field that can be inserted? And are there any limits on maximum # of rows fetched?

I need to be able to store millions of rows in the postgres db (one table).

Rich

unread,
Oct 12, 2015, 4:22:37 PM10/12/15
to
[NOTE - on Usenet, it is considered customary, and polite, to
bottom-reply to postings. Note how I modified your reply
below. There is a logical reason for this custom. Normal
English language reading order is top to bottom. By
bottom-replying you maintain the normal time ordering of the
replies, someone reading from top to bottom reads the quotes in
the time order within which they were made. In your posting,
one has to 1) skip your reply, read the rest top to bottom,
then jump back to the top to read your reply, in order to read
the message in time order.]

anj patnaik <pat...@gmail.com> wrote:
> On Thursday, October 8, 2015 at 10:21:21 PM UTC-4, lj wrote:
> > anj patnaik wrote:
> > > Is there a way to increase the time the pgintcl connection handle
> > > stays valid? I tried to run pg_conninfo command which apparently
> > > works in Pgtcl but not in pgintcl. Is there a similar command to
> > > check the connections status/increase connection alive time?
> > >
> > > I am referring to the output from:
> > > pg_connect -conninfo postgresql://postgres:pass@myserver:5432/postgres
> > >
> > > I noticed a case where the handle had become invalid and had to
> > > re-connect, but wanted to find out default behavior.
> >
> > There is no timeout for the connection handle. It stays valid and
> > open until you close it, unless there is a problem with the network
> > or server. If you are connecting to a database over an unreliable
> > network connection, you may have to deal with this at the
> > application level, by implementing error recovery and reconnection.
> >
> > I'm not aware of any implementation of pgtcl that has a
> > "pg_conninfo" command.
> >
> > (By the way, these are sort of off-topic for this newsgroup)

> Ok thanks. Is there a better forum to discuss pgintcl?

One of the postgresql mailing lists, perhaps. The *only* connection
you have to Tcl is that you are using a Tcl driver interface. Almost
100% of your questions have been directed towards Postgresql and not
Tcl directly.

> Is there a limit on the size of the text field that can be inserted?
> And are there any limits on maximum # of rows fetched?

Check the documentation. And ask in a Postgresql mailing list for
Postgresql's limits. In general, the usual upper limits would be
Postgresql's limits, or available memory in your client machine,
whichever exhausts first.

> I need to be able to store millions of rows in the postgres db (one table).

Storing millions of rows is not the same as fetching millions of rows
in one go. You can store in one table many more rows than you can
fetch in one go. If you encounter that case you just fetch sub-sets
and operate upon the subsets.

lj

unread,
Oct 12, 2015, 9:33:50 PM10/12/15
to
anj patnaik wrote:
> Ok thanks. Is there a better forum to discuss pgintcl?

On Sourceforge, the project has trackers and a discussion forum. It has almost
no activity, but it is there. PostgreSQL has its mailing lists, which are also
available on some news servers (but not Usenet).

> Is there a limit on the size of the text field that can be inserted? And
> are there any limits on maximum # of rows fetched?

Actually we are sort of back on topic for Tcl now. As pgintcl is written in
Tcl, all its memory allocation is handled by Tcl. (This is different from
other Pgtcl implementations, which use libpq, which allocates memory
outside of Tcl.) With Tcl, in my opinion and experience, you will run out
of patience before you run out of memory... What I mean is that you are
likely to reach a point where although Tcl can handle the memory
requirements, the overall performance is not good enough and you need to
look for another solution. This is especially true with pgintcl, if you are
planning to work with queries that transfer a lot of data.

0 new messages