PostgreSQL 8.0.0 �����ĵ���PostgreSQL �й� ������ | ||||
---|---|---|---|---|
Prev | Fast Backward | Chapter 5. ���ݶ��� | Fast Forward | Next |
����㴴����һ�������������Ҵ������Լ������ͼ�� �������������ȵȵĸ������ݿ�ṹ����ô��ͻ��ڶ��� ֮�������ش�����һ�������Ե����硣���磬һ��������� Լ���ı������������õı�
Ϊ�˱�֤�������ݿ�ṹ�������ԣ�PostgreSQL ��֤ ����ɾ����Щ�����������������Ķ����磬��ͼɾ�������� Section 5.4.5 ��ǵIJ�Ʒ�����ʱ�� ��������Ȼ��������������ɾ�������Dz��ܳɹ��ģ�������������Ĵ�����Ϣ���֣�
DROP TABLE products; NOTICE: constraint orders_product_no_fkey on table orders depends on table products ERROR: Cannot drop table products because other objects depend on it Use DROP ... CASCADE to drop the dependent objects too
���������Ϣ����һ�����õ���ʾ������㲻�������ֱ�ɾ������ ����������鷳�����������
DROP TABLE products CASCADE;
Ȼ�����б������Ķ�����ɾ��������������£� ������ɾ����������ֻɾ�����Լ��������������� DROP ... CASCADE ���ʲô�����в��� CASCADE �� DROPȻ���Ķ� NOTICE ��Ϣ����
PostgreSQL �������ɾ����� ֧������ CASCADE����Ȼ�������������ʵ�� ȡ���ڶ�������͡���Ҳ����д RESTRICT���� ���� CASCADE���Ի�ȡȱʡ����Ϊ�� ���ʱ��������ɾ����Щ�������������Ķ���
ע��: ���� SQL ����Ҫ���������� RESTRICT ���� CASCADE �е�һ���� ʵ����û���������ݿ�ϵͳ����ôʵ�ֵģ�����ȱʡ����Ϊ�� RESTRICT ���� CASCADE ����ϵͳ���졣
ע��: �� PostgreSQL 7.3 ֮ǰ�����Լ�������Ժ������ֶ������� �����������ж������õ�ά�����ߴ������������������������� �����������ж����õ�ǡ���Ĵ�����