From: Richard Broersma <richard.broersma@gmail.com>
To: Premsun Choltanwanich <Premsun@nsasia.co.th>
Cc: pgsql-odbc@postgresql.org
Subject: Re: PostgreSQL does not support updateable cursors
Date: Mon, 3 Mar 2008 06:31:36 -0800
Message-ID: <396486430803030631k6151b908p6995227883501ceb@mail.gmail.com> (raw)
In-Reply-To: <47CC056A.C5F7.004C.0@nsasia.co.th>
References: <47CC056A.C5F7.004C.0@nsasia.co.th>
On Sun, Mar 2, 2008 at 11:06 PM, Premsun Choltanwanich <Premsun@nsasia.co.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-odbc@postgresql.org
Cc: richard.broersma@gmail.com, Premsun@nsasia.co.th
Subject: Re: PostgreSQL does not support updateable cursors
In-Reply-To: <396486430803030631k6151b908p6995227883501ceb@mail.gmail.com>
References: <47CC056A.C5F7.004C.0@nsasia.co.th> <396486430803030631k6151b908p6995227883501ceb@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox