Cursors only see the data that is the effect of the query. That output
doesn't get updated. It would actually be pretty bad if that was the
case.
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-ge
On Tue, Jun 14, 2011 at 11:54 PM, Andy Chambers wrote:
> Hi,
>
> What happens to cursors when new data is added to a table after you
> start iterating
> over its rows?
>
> For example, given the following loop...
>
> for rule in select tc.sid, tc.s, td.rule, td.returns
> from t
Hi,
What happens to cursors when new data is added to a table after you
start iterating
over its rows?
For example, given the following loop...
for rule in select tc.sid, tc.s, td.rule, td.returns
from tcell tc
inner join tcelldef td on (tc.p = td.p)
Thanks for reply.
I do some checking and
some queries boost very well :)
pasman
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
2010/12/30 pasman pasmański
> Hello.
>
> I use Postgres 8.4.5 via perl DBI.
> And i try to use cursors WITH HOLD to materialize
> often used queries.
>
> My question is how many cursors may be
> declared per session and which memory setting s
> to adjust for them ?
>
I believe there's no maximum
Hello.
I use Postgres 8.4.5 via perl DBI.
And i try to use cursors WITH HOLD to materialize
often used queries.
My question is how many cursors may be
declared per session and which memory setting s
to adjust for them ?
regards.
pasman
--
Sent via pgsql-general mailing list (pgsq
hi guys,
i solved this particular issue using the fetch syntax, so thanks for the
tip. I agree with merlin that temp tables are a headache, also because i
can't run the same function again before processing the output;
I am not familiar with arrays, but it seems like a good solution for my
proble
On Tue, Apr 6, 2010 at 9:58 PM, Marc Menem wrote:
> Hi all,
>
> I'm trying to use a cursor returned by a function from another function. But
> I can't seem to get it working correctly. The error message is:
> ERROR: cursor FOR loop must use a bound cursor variable
> I am not sure how to bind it
Hello
2010/4/7 Marc Menem :
> Hi all,
>
> I'm trying to use a cursor returned by a function from another function. But
> I can't seem to get it working correctly. The error message is:
> ERROR: cursor FOR loop must use a bound cursor variable
> I am not sure how to bind it;
you can't do it now
Hi all,
I'm trying to use a cursor returned by a function from another function. But
I can't seem to get it working correctly. The error message is:
ERROR: cursor FOR loop must use a bound cursor variable
I am not sure how to bind it;
my code is similar to this:
create or replace function sto
On Sun, 2009-06-21 at 22:11 +0200, Ivan Sergio Borgonovo wrote:
> > > I think I really don't have a clear picture of how temp tables
> > > really work.
> > > They can be seen by concurrent transactions in the same session.
>
> > Eh? In this context, what do you mean by "session"? Did you mean
> >
On Sun, 21 Jun 2009 21:43:16 +0800
Craig Ringer wrote:
> On Sun, 2009-06-21 at 14:57 +0200, Ivan Sergio Borgonovo wrote:
>
> > I think everything could be summed up as:
> >
> > select into t myaggregate1(field) from dataset where condition1;
> > if(t>10) then
> > update dataset set field=myfu
On Sun, 2009-06-21 at 14:57 +0200, Ivan Sergio Borgonovo wrote:
> I think everything could be summed up as:
>
> select into t myaggregate1(field) from dataset where condition1;
> if(t>10) then
> update dataset set field=myfunc1(a,b,c) where condition1;
> end if;
>
> select into t myaggregate2(
On Sun, 21 Jun 2009 10:57:51 +0800
Craig Ringer wrote:
> On Fri, 2009-06-19 at 20:23 +0200, Ivan Sergio Borgonovo wrote:
>
> > If I could easily load all the dataset into an array, loop
> > through it and then just update the computed field it would be
> > nice... but how?
>
> Are you sure you
On 24/11/2007, Cesar Alvarez <[EMAIL PROTECTED]> wrote:
>
> Thanks,
> what will be the syntax for that type of for?
>
DECLARE
curs2 CURSOR FOR SELECT * FROM tenk1;
c1 integer;
c2 integer;
BEGIN
OPEN curs2;
FETCH curs2 INTO c1,c2;
WHILE found LOOP
...
FETCH curs2 INTO c1,c2;
Thanks,
what will be the syntax for that type of for?
Pavel Stehule wrote:
On 24/11/2007, Cesar Alvarez <[EMAIL PROTECTED]> wrote:
Hello every one.
im trying to make a Loop and i found in the manual this.
FOR IN LOOP
END LOOP
Can i use cursor instead of the Query in the loop??
On 24/11/2007, Cesar Alvarez <[EMAIL PROTECTED]> wrote:
>
> Hello every one.
> im trying to make a Loop and i found in the manual this.
>
> FOR IN LOOP
>
> END LOOP
>
> Can i use cursor instead of the Query in the loop?? ,
> this es more legible than using the open/fetch/close of the
Hello every one.
im trying to make a Loop and i found in the manual this.
FOR IN LOOP
END LOOP
Can i use cursor instead of the Query in the loop?? ,
this es more legible than using the open/fetch/close of the cursor.
Regard Cesar Alvarez.
begin:vcard
fn:Cesar Alvarez
n:;Cesar Alvarez
titl
On Mar 29, 2007, at 10:47 , Jasbinder Singh Bali wrote:
Hi,
I've written a function using cursors as follows:
can anyone please comment on the text in red.
--
CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text,
text, text)
Actually I'm doing a duplicate check
My function accepts 4 parameters.
If all four exist in a particular row then i should not be inserting that
record again.
so is
INSERT INTO table(a,b,c) SELECT 'a','b','c' WHERE NOT EXISTS
( SELECT * FROM table WHERE (a,b,c) = ('a','b','c') );
going to solve m
On Mar 29, 2007, at 10:47 , Jasbinder Singh Bali wrote:
Hi,
I've written a function using cursors as follows:
can anyone please comment on the text in red.
--
CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text,
text, text)
2007/3/29, Jasbinder Singh Bali <[EMAIL PROTECTED]>:
Hi,
I've written a function using cursors as follows:
can anyone please comment on the text in red.
--
CREATE OR REPLACE FUNCTION
sp_insert_tbl_email_address(int4, text, text, text)
RETUR
Hi,
I've written a function using cursors as follows:
can anyone please comment on the text in red.
--
CREATE OR REPLACE FUNCTION sp_insert_tbl_email_address(int4, text, text,
text)
RETURNS void AS
$BODY$
DECLARE
uid int4 ;
src text;
om: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ANJANE
Sent: Thursday, October 12, 2006 7:31 AM
To: pgsql-general@postgresql.org
Subject: SPAM-LOW: [GENERAL] cursors and ASP page
I have a postgresql function defined as follows ...
DECLARE int_userid ALIAS FOR $1;
BEGIN OPEN $2 FOR
SELEC
I have a postgresql function defined as follows ...
DECLARE int_userid ALIAS FOR $1;
BEGIN OPEN $2 FOR
SELECT DISTINCT
"users"."userloginid",
"roles"."rolelike"
FROM
"roles"
INNER JOIN "userpreferences" ON "roles"."roleid" =
"userpreferences"."roleid"
INNER JOIN "users" ON "use
[Please copy the mailing list on replies. I'm forwarding your
entire message to the list without comment so others can see it;
I'll look at it when I get a chance.]
On Thu, Jan 12, 2006 at 04:21:04PM +0200, Peter Filipov wrote:
> It is the second case.
>
> I find cursors as good way to pass a re
On Wed, Jan 11, 2006 at 01:41:31PM -0500, Will Glynn wrote:
> Michael Fuhr wrote:
>
> >...
> >
> >Is there a reason you'd want to use a cursor instead of, say, a view?
> >
> >Are you just curious or is there a problem you're trying to solve?
> >If I've misunderstood what you're asking then please
Will Glynn <[EMAIL PROTECTED]> writes:
> Why can't I SELECT multi_column_function(t.a) FROM some_table t?
You can. At least if you're running a recent release ;-)
regression=# create function foo(int, out f1 int, out f2 int) as $$
regression$# begin
regression$# f1 := $1 + 1;
regression$# f2
Michael Fuhr wrote:
...
Is there a reason you'd want to use a cursor instead of, say, a view?
Are you just curious or is there a problem you're trying to solve?
If I've misunderstood what you're asking then please elaborate.
I have previously thought this to be the most straightforward way
Michael Fuhr <[EMAIL PROTECTED]> writes:
> ... However, you could
> write a set-returning function that takes a refcursor argument and
> iterates through the cursor, returning each row, and use that
> function in the FROM clause. Whether that's a good idea or not is
> something I haven't given muc
On Wed, Jan 11, 2006 at 04:11:18PM +0200, Peter Filipov wrote:
> Is the idea to use cursors as table sources good?
> Do you plan to implement it in the future and if you plan will it be soon?
Do you mean the ability to use a cursor as one of the sources in
the FROM clause? Something like the foll
Hi,
Is the idea to use cursors as table sources good?
Do you plan to implement it in the future and if you plan will it be soon?
Regards,
Peter Filipov
--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
---(end of broadcast)--
On Tue, Nov 15, 2005 at 01:44:32PM -0500, Jerry LeVan wrote:
>
> What are some of the tradeoffs between using a cursor and using the
> limit/offset method of selecting rows to display?
OFFSET actually has to scan all the preceding rows every time (plus
to get it consistently, you need to do an OR
Hi,
I am mucking around trying to build a gui'sh "table editor" for
Postgresql.
I am currently using a "held" cursor to move around the table, Since the
"cursor" does not show table modification I am thinking about using the
"limit" and "offset" attributes to select the rows to display.
What
Hi!
Is there any possibility to get the number of rows resulted by SELECT
CURSOR?
Best Regards, Andrei.
---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
s
At 12:50 PM -0700 2/15/05, Michael Fuhr wrote:
On Tue, Feb 15, 2005 at 02:32:56PM -0500, Dan Sugalski wrote:
I've got some code that uses PQexecParams and does the equivalent of:
DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1
FETCH NEXT a_cursor
but when I get to th
On Tue, Feb 15, 2005 at 02:32:56PM -0500, Dan Sugalski wrote:
>
> I've got some code that uses PQexecParams and does the equivalent of:
>
>DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1
>FETCH NEXT a_cursor
>
> but when I get to the FETCH I'm getting back the error
When using cursors through the libpq interface, do I need to be
passing in the parameters when I'm FETCHing from them?
I've got some code that uses PQexecParams and does the equivalent of:
DECLARE a_cursor CURSOR FOR SELECT foo, bar FROM baz WHERE field = $1
FETCH NEXT a_cursor
but when I g
On Mon, 4 Oct 2004, Wiebe de Jong wrote:
> I am trying to implement cursors using JDBC connector version 7.1b5
> (postgresql-7.1b5.jar), but can't get it to work.
Before saying anything else, I have to tell you to get off 7.1, especially
a beta version of it.
The first JDBC driver to have curs
I am trying to implement cursors using JDBC connector version
7.1b5 (postgresql-7.1b5.jar), but can’t get it to work.
Could anybody suggest the proper way to do it, or even some
source code? I am stuck with this version and can’t change it.
Thanks
Wiebe de Jong
I'm not sure why you're doing it the exact way you are, but you basically
just call the same commands within a pg_query as you would on the psql
command line to make it work:
begin
declare mycurs cursor as select * from table
fetch 10
rollback / commit
---(end of bro
On 4/6/04 11:09 PM, "Tom Lane" <[EMAIL PROTECTED]> wrote:
> What "out of memory thing"? The tuplestore code is perfectly capable of
> spilling to disk --- in fact the usual performance gripe against it has
> to do with spilling too soon, because sort_mem is set too small.
I tried doing a mass up
On Apr 7, 2004, at 12:43 AM, Joe Conway wrote:
Eric Ridge wrote:
On Apr 6, 2004, at 11:54 AM, Jan Wieck wrote:
And now you know why they are so good if you don't use all rows.
This benefit I think goes away if you use Joe Conway's suggestion of
WITH HOLD.
Okay, so WITH HOLD is actually materiali
On Apr 7, 2004, at 7:51 AM, Jan Wieck wrote:
Eric Ridge wrote:
On Apr 6, 2004, at 11:54 AM, Jan Wieck wrote:
If the underlying query is for example a simple sequential scan,
then the result set is not materialized but every future fetch
operation will read directly from the base table. This woul
Eric Ridge wrote:
On Apr 6, 2004, at 11:54 AM, Jan Wieck wrote:
If the underlying query is for example a simple sequential scan, then
the result set is not materialized but every future fetch operation
will read directly from the base table. This would obviously get
screwed up if vacuum would th
Eric Ridge wrote:
On Apr 6, 2004, at 11:54 AM, Jan Wieck wrote:
And now you know why they are so good if you don't use all rows. This
benefit I think goes away if you use Joe Conway's suggestion of WITH
HOLD.
Okay, so WITH HOLD is actually materializing the entire resultset
(sequential scan or o
On 4/6/04 10:54 AM, "Jan Wieck" <[EMAIL PROTECTED]> wrote:
>> Cursors seem as if they have some nice performance benefits (esp. if
>> you're not using all rows found), but their usefulness drops
>> considerably since you must leave a transaction open.
>
> And now you know why they are so good if
Jan Wieck <[EMAIL PROTECTED]> writes:
> Ian Lance Taylor wrote:
> >
> > I have a patch which adds support for cursors in PL/pgSQL. If anybody
> > is interested, I can provide that patch against either 7.0.3 or the
> > current CVS sources. I have sent it to the maintainers, and they will
> > con
Ian Lance Taylor wrote:
> Camm Maguire <[EMAIL PROTECTED]> writes:
>
> > Greetings! Just read that this functionality is planned for the
> > future. Can 7.1 have cursors in pgsql functions, for example?
>
> No, it can't.
>
> I have a patch which adds support for cursors in PL/pgSQL. If anybody
Camm Maguire <[EMAIL PROTECTED]> writes:
> Greetings! Just read that this functionality is planned for the
> future. Can 7.1 have cursors in pgsql functions, for example?
No, it can't.
I have a patch which adds support for cursors in PL/pgSQL. If anybody
is interested, I can provide that pat
Greetings! Just read that this functionality is planned for the
future. Can 7.1 have cursors in pgsql functions, for example?
Take care,
--
Camm Maguire[EMAIL PROTECTED]
==
"The
PostgreSQL JDBC: http://www.retep.org.uk/postgres/
Java PDF Generator: http://www.retep.org.uk/pdf/
- Original Message -
From: "Travis Bauer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 30, 2000 2:52 PM
Subject: [GENERAL] Cursors and JDBC
> Doe
Does the JDBC driver support the user of cursors in postgresql 7.0.2?
Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer
53 matches
Mail list logo