第2章��weather
�ơ��֥��cities
�ơ��֥��פ��Ф��Ƥ������������Τ褦����������ͤ��Ƥߤޤ��礦��cities
�ơ��֥�˰��פ�����ܤ��ʤ��Ԥ����Ф�weather
�ơ��֥�������Ǥ��ʤ��������Ȥ��ޤ��������ǡ����������������������ȸƤӤޤ����Ǥ�ñ��ʥǡ����١��������ƥ�Ǥ�cities
�ơ��֥�˰��פ���Ԥ�¸�ߤ��뤫�ɤ�����ǽ�˸��ڤ��Ƥ���weather
�ơ��֥�˿����쥳���ɤ��ɲä��뤫�ݤ���������ʤ���Фʤ�ޤ����μ�ˡ�ˤ�¿�������꤬���뤳�ȡ������ƤȤƤ����ؤǤ��뤳�Ȥ��顢PostgreSQL�����äƺ�Ȥ����뤳�Ȥ��Ǥ��ޤ���
�����Υơ��֥������ϰʲ��Τ褦�ˤʤ�ޤ���
CREATE TABLE cities ( city varchar(80) primary key, location point ); CREATE TABLE weather ( city varchar(80) references cities(city), temp_lo int, temp_hi int, prcp real, date date );
�Ǥ�̵���ʥ쥳���ɤ��������Ƥߤޤ��礦��
INSERT INTO weather VALUES ('Berkeley', 45, 53, 0.0, '1994-11-28');
ERROR: insert or update on table "weather" violates foreign key constraint "weather_city_fkey" DETAIL: Key (city)=(Berkeley) is not present in table "cities".
���������ˤ�뿶�ǥ��ץꥱ����������˥��塼�˥���ޤ��������Υ��塼�ȥꥢ��ǤϤ��δ�ñ����������ˤϿʤߤޤ�������˾��ۤ�������第5章���������������������������������Ѥ���褦�ˤ���ȡ��ְ㤤�ʤ��ǡ����١������ץꥱ�������μ�����夵���ޤ��ΤǿȤ��դ��褦�����Ǥ���������