Re: PostgreSQL does not support updateable cursors

From: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>
To: "Premsun Choltanwanich" <Premsun(at)nsasia(dot)co(dot)th>
Cc: pgsql-odbc(at)postgresql(dot)org
Subject: Re: PostgreSQL does not support updateable cursors
Date: 2008-03-03 14:31:36
Message-ID: 396486430803030631k6151b908p6995227883501ceb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

On Sun, Mar 2, 2008 at 11:06 PM, Premsun Choltanwanich <Premsun(at)nsasia(dot)co(dot)th>
wrote:

> Dear All,
>
> Regarding to my conversation on mailing list as shown below, Is my
> problem related with any function on psqlODBC ? And, How can I fix it?
>
>
No, the problem is not with the ODBC driver. The problem is that views in
postgresql are static non-update-able by default. So if you try to update
and record in a view using a cursor or any other sql statement, you will get
an error.

This problem can be fixed if your view meets the following criteria:

1) your view is based on only one table

2) your create rules for your view that define how updates to the view are
to be handled/cascaded to the base table.
http://www.postgresql.org/docs/8.3/interactive/sql-createrule.html

3) since postgresql rules can only handle update statements that affect only
one tuple at a time, your cursor must only be able to update one record at a
time.

Regards,
Richard Broersma Jr.

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Son Osiris 2008-03-03 17:12:14 Symbol files
Previous Message Premsun Choltanwanich 2008-03-03 07:06:03 PostgreSQL does not support updateable cursors