Re: Practical Cursors
От | Joe Conway |
---|---|
Тема | Re: Practical Cursors |
Дата | |
Msg-id | 021b01c13fc3$a3a29b80$6cdc10ac@jecw2k1 обсуждение исходный текст |
Ответ на | Practical Cursors ("Command Prompt, Inc." <pgsql-general@commandprompt.com>) |
Ответы |
Re: Practical Cursors
|
Список | pgsql-general |
> However, using something like PHP will not allow this because HTTP is > stateless and PostgreSQL will not know from one transaction to the next > that the results of the connection are related. > > Is this truly the case, or is there a way for PostgreSQL to remember the > connection identifier so that the next time a PHP connection is made with > the same identifier a transaction can be completed? > > Sincerely, > > Joshua Drake > I have actually been thinking recently about just this question. I looked through the source for the PHP pgsql extension and it is clear that no cursor is used. There is, however, the ability to open a persistent connection to PostgreSQL from PHP. I think it would be possible to create a persistent resource identifier to a cursor in a similar manner, and "reuse" the cursor across multiple HTTP requests. The downside I can see is that PHP would have no way to know when it could garbage-collect the allocated resource. So while it could be done, what would happen when the user closes their browser with your cursor still open? -- Joe
В списке pgsql-general по дате отправления: