Thread: bidirectional cursors on views

bidirectional cursors on views

From
Shachar Shemesh
Date:
Hi all,

When I try to open (using MFC) a non-forward only cursor on a view (i.e. 
- select * from viewname), I get an error of "attribute ctid not found". 
There are some chances that this is an ODBC problem, but my research 
suggests that the dependancy on ctid is created by the database itself.

Can anyone comment about this? Is this problem solveable?
         Shachar

-- 
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/




Re: bidirectional cursors on views

From
Tom Lane
Date:
Shachar Shemesh <psql@shemesh.biz> writes:
> When I try to open (using MFC) a non-forward only cursor on a view (i.e. 
> - select * from viewname), I get an error of "attribute ctid not found". 
> There are some chances that this is an ODBC problem, but my research 
> suggests that the dependancy on ctid is created by the database itself.

Your research is faulty --- it's an ODBC issue.

> Can anyone comment about this? Is this problem solveable?

You'd have better luck asking on pgsql-odbc, but my guess is that they
depend on ctid as a (crude) form of unique row identification.
        regards, tom lane


Re: bidirectional cursors on views

From
Shachar Shemesh
Date:
Tom Lane wrote:

>Shachar Shemesh <psql@shemesh.biz> writes:
>  
>
>>When I try to open (using MFC) a non-forward only cursor on a view (i.e. 
>>- select * from viewname), I get an error of "attribute ctid not found". 
>>There are some chances that this is an ODBC problem, but my research 
>>suggests that the dependancy on ctid is created by the database itself.
>>    
>>
>
>Your research is faulty --- it's an ODBC issue.
>  
>
Am I to understand that psql's nativ cursors support bidirectional 
movements on views? That is good news, actually.

>>Can anyone comment about this? Is this problem solveable?
>>    
>>
>
>You'd have better luck asking on pgsql-odbc, but my guess is that they
>depend on ctid as a (crude) form of unique row identification.
>
That was my guess as well. I did ask at pgsql-odbc on Wendsday. When 
noone answered, I did the open source thing and tried to singstep the 
code. Thing is - I placed a breakpoint on all occurances of "ctid" in 
the ODBC driver's code, and none of those breakpoints were hit when the 
query that didn't go through was sent. That's the reason I arrived at 
the conclusion I did.

If you can tell me for sure that such cursors are, in fact, supported by 
pgsql itself, then I'll go back to the odbc sources and, if necessary, 
implement this (not happy about those prospects - I don't know ODBC 
worth of manure).

>            regards, tom lane
>  
>
Many thanks,
            Shachar

-- 
Shachar Shemesh
Open Source integration consultant
Home page & resume - http://www.shemesh.biz/




Re: bidirectional cursors on views

From
Tom Lane
Date:
Shachar Shemesh <psql@shemesh.biz> writes:
> Am I to understand that psql's nativ cursors support bidirectional 
> movements on views? That is good news, actually.

They do.  (Complex views, like joins, may not work real well before
7.4.)

I suspect your real difficulty is that a view will not expose the ctid
column of the underlying table (if any).
        regards, tom lane