PostgreSQL
- 13 ответов
- 0 вопросов
4
Вклад в тег
EXPLAIN ANALYZE SELECT * FROM b WHERE a_id='123' ORDER BY time DESC;
CREATE TRIGGER maintable_pricetable_sum_trigger_insert
BEFORE INSERT
ON maintable_pricetable
FOR EACH ROW
BEGIN
SET NEW.outcome = (NEW.transparency + NEW.color + NEW.pis + NEW.purity + NEW.intensity + NEW.typicality + NEW.purity2 + NEW.intensity2 + NEW.persistence + NEW.typicality2 + NEW.harmony);
END;
CREATE TRIGGER maintable_pricetable_sum_trigger_update
BEFORE UPDATE
ON maintable_pricetable
FOR EACH ROW
BEGIN
SET NEW.outcome = (NEW.transparency + NEW.color + NEW.pis + NEW.purity + NEW.intensity + NEW.typicality + NEW.purity2 + NEW.intensity2 + NEW.persistence + NEW.typicality2 + NEW.harmony);
END;
ALTER TABLE ticket RENAME TO ticket_part_default;
CREATE TABLE ticket (LIKE ticket_part_default);
ALTER TABLE ticket_part_default INHERIT ticket;
...