X-Original-To: pgsql-odbc@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 1C56C474E61 for ; Fri, 14 Feb 2003 11:31:47 -0500 (EST) Received: from MX1.estpak.ee (ld1.estpak.ee [194.126.101.98]) by postgresql.org (Postfix) with ESMTP id 79F5B474E5C for ; Fri, 14 Feb 2003 11:31:46 -0500 (EST) Received: from tmkodu (80-235-71-26-dsl.trt.estpak.ee [80.235.71.26]) by MX1.estpak.ee (Postfix) with SMTP id 3CCC588876; Fri, 14 Feb 2003 18:30:35 +0200 (EET) Message-ID: <00b101c2d447$2d980820$0100a8c0@kodunet.ee> From: "Tambet Matiisen" To: "Ian Sealy" , Cc: "Ed Crewe" , "Jan Grant" References: Subject: Re: Views and Access 2000 Date: Fri, 14 Feb 2003 18:36:08 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/69 X-Sequence-Number: 2687 7.3 fixes this. See http://www.postgresql.org/docs/view.php?version=7.3&idoc=0&file=rules-status .html. Tambet ----- Original Message ----- From: "Ian Sealy" To: Cc: "Ed Crewe" ; "Jan Grant" Sent: Friday, February 14, 2003 3:40 PM Subject: [ODBC] Views and Access 2000 > Hi, > > We're using Access 2000 as a frontend to PostgreSQL, using the latest > PostgreSQL ODBC driver (7.02.00.05). > > This was originally just an Access database and I'm using views to mimic > the original Access tables, with rules that update the underlying > PostgreSQL tables when the views are changed. These rules work fine if > the views are changed via psql. They also work fine from Access 2000 if > the PostgreSQL database used is version 7.1.2, but they don't work with > version 7.2.3. > > Here's a simple example. Here's the table: > > CREATE SEQUENCE "test_table_seq" start 1 increment 1 maxvalue 2147483647 minvalue 1 cache 1; > CREATE TABLE "test_table" ( > "table_id" integer DEFAULT nextval('"test_table_seq"'::text) NOT NULL, > "field" character varying(50) > ); > > Here's the view: > > CREATE VIEW "TestView" as SELECT test_table.table_id AS "TableID", field AS "Field" FROM test_table; > > And here are the rules: > > CREATE RULE test_update AS ON UPDATE TO "TestView" DO INSTEAD UPDATE test_table SET field=new."Field" WHERE table_id=old."TableID"; > CREATE RULE test_insert AS ON INSERT TO "TestView" DO INSTEAD INSERT INTO test_table (field) VALUES (new."Field"); > CREATE RULE test_delete AS ON DELETE TO "TestView" DO INSTEAD DELETE FROM test_table WHERE table_id=old."TableID"; > > As I say, everything works properly with PostgreSQL 7.1.2, but not with > PostgreSQL 7.2.3 (using the Red Hat packages under Red Hat 7.3). If I > try and insert a record then I get an error from Access: > > The field is too small to accept the amount of data you attempted to > add. Try inserting or pasting less data. > > If I try and update an existing record then I get this error: > > Write Conflict > > This record has been changed by another user since you started editing > it... > > If I try and delete a record then I get: > > The Microsoft Jet database engine stopped the process because you and > another user are attempting to change the same data at the same time. > > I don't think the FAQ at > http://gborg.postgresql.org/project/psqlodbc/faq/faq.php?faq_id=59 > explains this, because I get the same error even when updating a row > that doesn't contain empty strings. Also there aren't any timestamps > involved. > > Has anyone got any suggestions? I'd prefer to carry on using the Red Hat > PostgreSQL packages, but I'd be happy to upgrade to PostgreSQL 7.3.2 if > someone thought that that would solve the problem. > > Cheers, > Ian > > -- > Dr Ian Sealy > Internet Development > Institute for Learning and Research Technology > University of Bristol > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >