odin's small box
�^�C�g���̒ʂ�ł����APostgreSQL �ł́ATRUNCATE TABLE �� �g�����U�N�V�������Ȃ̂ŁA���[���o�b�N����� �f�[�^�͌��ɖ߂�܂��B
���̂悤�ɂȂ�܂��B
postgres=# select * from test1; f1 | f2 ----+---- 1 | 1 2 | 2 (2 rows) postgres=# begin; BEGIN postgres=# truncate table test1; TRUNCATE TABLE postgres=# select * from test1; f1 | f2 ----+---- (0 rows) postgres=# rollback; ROLLBACK postgres=# select * from test1; f1 | f2 ----+---- 1 | 1 2 | 2 (2 rows)
�ʔ����̂́ACREATE TABLE �Ȃǂ��g�����U�N�V�������ł��B
postgres=# begin; BEGIN postgres=# create table test2 (f1 varchar(1), f2 int); CREATE TABLE postgres=# select * from test2; f1 | f2 ----+---- (0 rows) postgres=# rollback; ROLLBACK postgres=# select * from test2; ERROR: relation "test2" does not exist
���R�A���̃g�����U�N�V�������R�~�b�g����܂ł́A �ʂ̃g�����U�N�V��������� test2 �e�[�u���͌����܂���B
�ʂ̃g�����U�N�V����������ł���Ə�����₱�����Ȃ�܂��B
�g�����U�N�V���� A ���g�����U�N�V�������Ƀe�[�u�����쐬���Ă���Ƃ��� ���̃g�����U�N�V���� B �������e�[�u�����Ńe�[�u�����쐬���悤�Ƃ���� �g�����U�N�V���� B �� A �̌��ʑ҂��ɂȂ�܂��B
�g�����U�N�V���� A �����[���o�b�N���� �e�[�u���̍쐬���L�����Z�����ꂽ�ꍇ �g�����U�N�V���� B ���e�[�u�����쐬�ł���̂ŁA �g�����U�N�V���� B �̓g�����U�N�V�������p���ł��܂��B
�������A�g�����U�N�V���� A ���R�~�b�g���� �e�[�u�����쐬���m�肵�Ă��܂����ꍇ�́A �g�����U�N�V���� B �̓e�[�u���̍쐬���ł��Ȃ��̂��� B ���́A���̃G���[���������܂��B
ERROR: duplicate key value violates
unique constraint "pg_type_typname_nsp_index"
DROP TABLE �����l�̂��Ƃ��N����܂��B
���܂肱���������P�[�X�͂Ȃ��Ǝv���܂����A ���̕ӂ�̓����� Oracle �ƈقȂ�̂Œ��ӂ��K�v�ł��B