Database Reference
In-Depth Information
(3,'16-APR-2008',1800,'Islamabad');
warehouse_db=# INSERT INTO sales_record_listpart
(id, sales_date, sales_amount, city)
VALUES
(4,'20-APR-2008',1300,'new york');
When you perform the preceding INSERT statements, you
will observe that the INSERT query returns the INSERT 0 0
message; this is because the record is inserted in the child
tables instead of the master tables.
Perform SELECT on select_record_list1 to verify that the record is inserted as
expected in the following manner:
warehouse_db=# SELECT * FROM sales_record_list1;
id | sales_date | sales_amount | city
----+------------+--------------+----------
1 | 2008-04-15 | 1200 | sydney
4 | 2008-04-20 | 1300 | new york
(2 rows)
Perform SELECT on select_record_list2 to verify that the record is inserted as
expected in the following manner:
warehouse_db=# SELECT * FROM sales_record_list2;
id | sales_date | sales_amount | city
----+------------+--------------+-----------
2 | 2008-04-15 | 1500 | Boston
3 | 2008-04-16 | 1800 | Islamabad
(2 rows)
Summary
Let's summarize what you have learned in this chapter. You learned about
partitioning a table using the parent and child table inheritance structure. You
also learned about different types of partitioning that PostgreSQL supports. We
also took a walk through the usage of trigger functions that handle the DML and
DDL operations for a partitioned table. In the next chapter, which is about query
optimization, you will learn how you can expand a database eficiently and perform
database tuning.
 
Search WWH ::




Custom Search