Is this the warning message I should pay attention on it, during table partition

Поиск
Список
Период
Сортировка
От Yan Cheng Cheok
Тема Is this the warning message I should pay attention on it, during table partition
Дата
Msg-id 740794.70467.qm@web65707.mail.ac4.yahoo.com
обсуждение исходный текст
Ответы Re: Is this the warning message I should pay attention on it, during table partition  (Grzegorz Jaśkiewicz <gryzman@gmail.com>)
Re: Is this the warning message I should pay attention on it, during table partition  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
Список pgsql-general
I am implementing table partition.

    -- There is reason behind why we do not want to use trigger technique for table unit.
    -- Please refer to : http://archives.postgresql.org/pgsql-general/2010-01/msg01184.php
    -- INSERT INTO unit(fk_lot_id, cycle)
    -- VALUES(_lotID, _cycle) RETURNING  unit_id INTO _unit_id;
    unit_table_index = _lotID;
    unit_table_name = 'unit_' || _lotID;

    IF NOT EXISTS(SELECT * FROM information_schema.tables WHERE table_name = unit_table_name) THEN
        EXECUTE 'CREATE TABLE ' || quote_ident(unit_table_name) || '
        (
          unit_id bigserial NOT NULL,
          fk_lot_id bigint NOT NULL,
          CHECK (fk_lot_id = ' || (unit_table_index) || '),
          CONSTRAINT pk_unit_' || unit_table_index || '_id PRIMARY KEY (unit_id),
          CONSTRAINT fk_lot_' || unit_table_index || '_id FOREIGN KEY (fk_lot_id) REFERENCES lot (lot_id) MATCH SIMPLE
ONUPDATE NO ACTION ON DELETE CASCADE     
        ) INHERITS (unit);';

        EXECUTE 'CREATE INDEX fk_lot_' || unit_table_index || '_id_idx ON ' || quote_ident(unit_table_name) ||
'(fk_lot_id);';      
    END IF;

    EXECUTE 'INSERT INTO ' || quote_ident(unit_table_name) || '(fk_lot_id, cycle) VALUES (' || _lotID || ',' || _cycle
||') RETURNING unit_id' 
    INTO _unit_id;

    _unit.unit_id = _unit_id;
    _unit.fk_lot_id = _lotID;
    _unit.cycle = _cycle;

However, I always get the following message, when there is a new table need to be created.

NOTICE:  CREATE TABLE will create implicit sequence "unit_2_unit_id_seq" for serial column "unit_2.unit_id"
CONTEXT:  SQL statement "CREATE TABLE unit_2
        (
          unit_id bigserial NOT NULL,
          fk_lot_id bigint NOT NULL,
          CHECK (fk_lot_id = 2),
          CONSTRAINT pk_unit_2_id PRIMARY KEY (unit_id),
          CONSTRAINT fk_lot_2_id FOREIGN KEY (fk_lot_id) REFERENCES lot (lot_id) MATCH SIMPLE ON UPDATE NO ACTION ON
DELETECAS 
CADE
        ) INHERITS (unit);"
PL/pgSQL function "insert_unit" line 29 at EXECUTE statement
NOTICE:  merging column "unit_id" with inherited definition

Is this the warning message I should take any action on it? If not, how I can suppress it? It is quite annoying, when I
sawthese message keep printing out from my c++ console. 

Thanks and Regards
Yan Cheng CHEOK





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

Предыдущее
От: Yan Cheng Cheok
Дата:
Сообщение: Use Trigger to Remove Table itself when there is no row after delete
Следующее
От: Grzegorz Jaśkiewicz
Дата:
Сообщение: Re: Is this the warning message I should pay attention on it, during table partition