Skip site navigation (1) Skip section navigation (2)

Re: ODBC Open cursors on views

From: Shachar Shemesh <psql(at)shemesh(dot)biz>
To: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: ODBC Open cursors on views
Date: 2003-08-18 10:26:28
Message-ID: 1061202388.3f40a9d443f29@latenight.fiasco.org.il (view raw or flat)
Thread:
Lists: pgsql-odbc
Quoting Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>:

> Shachar Shemesh wrote:
> > 
> > Quoting Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>:
> > 
> > > Shachar Shemesh wrote:
> > > >
> > > > Hi all,
> > > >
> > > > When trying to open a bidirectional cursor on a query that uses a
> view
> > > in the
> > > > from (i.e. - select * from "viewname"), the odbc driver returns an
> > > error
> > > > "Attribute ctid not found". The problem does not happen when I
> open a
> > > forward
> > > > only cursor.
> > >
> > > Is the bidirectional cursor read-only ?
> > >
> > I tried it both ways - neither worked.
> 
> The static read-only cursor on views works here.
>  
> > This is a company I'm helping to add a backend to postgresql (they
> currently
> > support Oracle, MSsql and Access). They occasionally also do updates
> on views
> > (rare), so I guess that would come at some stage as well.
> 
> Updatable cursors in psqlodbc needs CTID and OID columns.
> If you create views with CTID and OID columns, you would
> probably get updatable bidirectinal cursors on the views.
> 
> 	CREATE VIEW a_view as select ctid, oid, ...  
> 
> regards,
> Hiroshi Inoue
> 	http://www.geocities.jp/inocchichichi/psqlodbc/
> 

If more than one table participates in the view, who's CTID do I need to get? Is
it enough to take one of the tables at random?

Assuming I don't want to use static cursors (I understand their performance is
not as good), and that the view's expression is rather complicated (lots of
joins from different tables), am I expected to run into trouble if I just pick a
table at random and add it's CTID to the view?

           Shachar

In response to

Responses

pgsql-odbc by date

Next:From: Josh BerkusDate: 2003-08-18 18:37:41
Subject: Need ODBC developer ASAP
Previous:From: Hiroshi InoueDate: 2003-08-18 10:11:31
Subject: Re: ODBC Open cursors on views

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group