updating derived classes

From: Ami Ganguli <ami(at)ganguli(dot)com>
To: bugs(at)postgreSQL(dot)org
Subject: updating derived classes
Date: 2000-07-05 00:18:07
Message-ID: 20000705041808.3000.qmail@pb151.postoffice.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=========================================================================
POSTGRESQL BUG REPORT TEMPLATE
========================================================================

Your name : Ami Ganguli
Your email address : ami(at)ganguli(dot)com

System Configuration
---------------------
Architecture (example: Intel Pentium) : AMD Athlon

Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.16 ELF

PostgreSQL version (example: PostgreSQL-6.5.1): PostgreSQL-7.0.2

Compiler used (example: gcc 2.8.0) : not sure (from RPM)

Please enter a FULL description of your problem:
------------------------------------------------

When UPDATING a table that has derived classes the documentation states that
the plain UPDATE command should update all the derived classes as well.
(UPDATE ONLY would update only the specified class.) This doesn't seem to
work and I can't figure out how to update both all the derived classes without
copious amounts of code.

Please describe a way to repeat the problem. Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

tester=# create table parent ( a int );
CREATE
tester=# create table child ( b int ) inherits ( parent );
CREATE
tester=# insert into child values ( 1, 2 );
INSERT 19253 1
tester=# select * from parent*;
a
---
1
(1 row)

tester=# update parent set a=2;
UPDATE 0
tester=# update parent* set a=2;
ERROR: parser: parse error at or near "*"

If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

Thanks for any help with this. I can work around the problem, but the
resulting code would be quite unweildy and a bear to maintain. Is there a
clean workaround?

... Ami.

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2000-07-05 16:03:46 Re: upper() problem in 7.0.2
Previous Message Tom Lane 2000-07-04 04:59:51 Re: Bug: Contrib\fulltextindex\fti.c?