Re: [HACKERS] pg_attribute.attisinherited ?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [HACKERS] pg_attribute.attisinherited ?
Дата
Msg-id 20020824184912.13f4b492.alvherre@atentus.com
обсуждение исходный текст
Ответы Re: [HACKERS] pg_attribute.attisinherited ?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Список pgsql-patches
En Sat, 24 Aug 2002 17:09:55 -0400
I said:

> > I remember Tom suggested adding something like attisinherited and
> > preventing this kind of operations on such attributes, because one can
> > do things such as [...]

Ok, I attach a patch that does this.  It doesn't include regression
tests, docs nor the checks against unwanted operations; these will come
later if people think this is a good approach.

It passes 86 of 88 tests.  The 2 failures are ordering issues (diff
below) I don't know what causes it.

Please review.


*** ./expected/select_having.out    Wed Jun 26 17:58:56 2002
--- ./results/select_having.out    Sat Aug 24 18:32:16 2002
***************
*** 26,33 ****
      GROUP BY b, c HAVING b = 3;
   b |    c
  ---+----------
-  3 | BBBB
   3 | bbbb
  (2 rows)

  SELECT lower(c), count(c) FROM test_having
--- 26,33 ----
      GROUP BY b, c HAVING b = 3;
   b |    c
  ---+----------
   3 | bbbb
+  3 | BBBB
  (2 rows)

  SELECT lower(c), count(c) FROM test_having
***************
*** 43,50 ****
      GROUP BY c HAVING count(*) > 2 OR min(a) = max(a);
      c     | max
  ----------+-----
-  XXXX     |   0
   bbbb     |   5
  (2 rows)

  DROP TABLE test_having;
--- 43,50 ----
      GROUP BY c HAVING count(*) > 2 OR min(a) = max(a);
      c     | max
  ----------+-----
   bbbb     |   5
+  XXXX     |   0
  (2 rows)

  DROP TABLE test_having;

======================================================================

*** ./expected/rules.out    Mon Aug 19 01:08:30 2002
--- ./results/rules.out    Sat Aug 24 18:32:46 2002
***************
*** 404,412 ****
  ----------------------+--------------+------------+------------+------------
   gates                | t            | fired      |      $0.00 | $80,000.00
   gates                | t            | hired      | $80,000.00 |      $0.00
-  wiech                | t            | hired      |  $5,000.00 |      $0.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
  (5 rows)

  insert into rtest_empmass values ('meyer', '4000.00');
--- 404,412 ----
  ----------------------+--------------+------------+------------+------------
   gates                | t            | fired      |      $0.00 | $80,000.00
   gates                | t            | hired      | $80,000.00 |      $0.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
+  wiech                | t            | hired      |  $5,000.00 |      $0.00
  (5 rows)

  insert into rtest_empmass values ('meyer', '4000.00');
***************
*** 421,429 ****
   maier                | t            | hired      |  $5,000.00 |      $0.00
   mayr                 | t            | hired      |  $6,000.00 |      $0.00
   meyer                | t            | hired      |  $4,000.00 |      $0.00
-  wiech                | t            | hired      |  $5,000.00 |      $0.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
  (8 rows)

  update rtest_empmass set salary = salary + '1000.00';
--- 421,429 ----
   maier                | t            | hired      |  $5,000.00 |      $0.00
   mayr                 | t            | hired      |  $6,000.00 |      $0.00
   meyer                | t            | hired      |  $4,000.00 |      $0.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
+  wiech                | t            | hired      |  $5,000.00 |      $0.00
  (8 rows)

  update rtest_empmass set salary = salary + '1000.00';
***************
*** 439,447 ****
   mayr                 | t            | honored    |  $7,000.00 |  $6,000.00
   meyer                | t            | hired      |  $4,000.00 |      $0.00
   meyer                | t            | honored    |  $5,000.00 |  $4,000.00
-  wiech                | t            | hired      |  $5,000.00 |      $0.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
  (11 rows)

  delete from rtest_emp where ename = rtest_empmass.ename;
--- 439,447 ----
   mayr                 | t            | honored    |  $7,000.00 |  $6,000.00
   meyer                | t            | hired      |  $4,000.00 |      $0.00
   meyer                | t            | honored    |  $5,000.00 |  $4,000.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
+  wiech                | t            | hired      |  $5,000.00 |      $0.00
  (11 rows)

  delete from rtest_emp where ename = rtest_empmass.ename;
***************
*** 459,467 ****
   meyer                | t            | fired      |      $0.00 |  $5,000.00
   meyer                | t            | hired      |  $4,000.00 |      $0.00
   meyer                | t            | honored    |  $5,000.00 |  $4,000.00
-  wiech                | t            | hired      |  $5,000.00 |      $0.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
  (14 rows)

  --
--- 459,467 ----
   meyer                | t            | fired      |      $0.00 |  $5,000.00
   meyer                | t            | hired      |  $4,000.00 |      $0.00
   meyer                | t            | honored    |  $5,000.00 |  $4,000.00
   wieck                | t            | honored    |  $6,000.00 |  $5,000.00
   wieck                | t            | honored    |  $7,000.00 |  $6,000.00
+  wiech                | t            | hired      |  $5,000.00 |      $0.00
  (14 rows)

  --

======================================================================


--
Alvaro Herrera (<alvherre[a]atentus.com>)
"Un poeta es un mundo encerrado en un hombre" (Victor Hugo)

Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: (yet) more buffer paranoia
Следующее
От: Neil Conway
Дата:
Сообщение: CREATE INDEX error message