Re: [HACKERS] pg_attribute.attisinherited ?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: [HACKERS] pg_attribute.attisinherited ?
Дата
Msg-id 20020826052821.74f4b1a2.alvherre@atentus.com
обсуждение исходный текст
Ответ на Re: [HACKERS] pg_attribute.attisinherited ?  (Christopher Kings-Lynne <chriskl@familyhealth.com.au>)
Ответы Re: [HACKERS] pg_attribute.attisinherited ?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
En Sun, 25 Aug 2002 17:34:21 +0800 (WST)
Christopher Kings-Lynne <chriskl@familyhealth.com.au> escribió:

Hi again,

> Yeah it is an issue that needs to be fixed.

I'm thinking about the ONLY part in the grammar in ALTER TABLE... DROP
COLUMN and RENAME COLUMN.  I think they should not be there:  they only
create noise and chances of ill behavior.  If I modify only the parent
table, then I'm able to create a column on the child table with
different datatype and same name as new column on parent, causing
subsequent backend crash.

Consider

CREATE TABLE foo (a int);
CREATE TABLE bar () INHERITS (foo);
ALTER TABLE ONLY foo RENAME a TO b;
ALTER TABLE bar ADD COLUMN b TEXT;

regression=# INSERT INTO bar values (1, 'hello world');
INSERT 205625 1
regression=# SELECT * FROM foo;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!#

What does people think about removing the support for ONLY in these
directives?

But this is a different problem and requires a different patch.


Here I post a new version of attisinherited; this one includes the tests
in AlterTableDropColumn and renameatt so inherited columns can not be
dropped nor renamed.  Please review this new version.  Regression tests
are also included, as is the modification of catalog.sgml.

--
Alvaro Herrera (<alvherre[a]atentus.com>)
"El Maquinismo fue proscrito so pena de cosquilleo hasta la muerte"
(Ijon Tichy en Viajes, Stanislaw Lem)

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] TODO Done. Superuser backend slot reservations
Следующее
От: "Nigel J. Andrews"
Дата:
Сообщение: Re: [HACKERS] TODO Done. Superuser backend slot reservations