2018/09/01 썸네일형 리스트형 (PostgreSQL) Default 값이 있는 새로운 필드 추가하기 Default 값이 있는 새로운 필드 추가하기ALTER TABLE orders ADD COLUMN price bigint NOT NULL DEFAULT 0; PostgreSQL 10 이하 버전에서는 테이블에 Default 값이 있는 필드를 추가할 땐 주의해야한다. Default값이 있는 필드를 추가할 때, 테이블을 다시 만들어내기 때문이다!그러면 시간도 오래걸리고, ACCESS EXCLUSIVE LOCK도 잡게 된다. ( 참고 - Fast Column Creation with Defaults )ACCESS EXCLUSIVE LOCK이 걸려있는 동안, 이 테이블에 대한 모든 트랜잭션은 BLOCK된다! SELECT 쿼리까지 막힌다! ( ACCESS EXCLUSIVE LOCK LEVEL은 LOCK LEVEL .. 제럴드 와인버그 <Quality Software Book : How Software Is Built > - 4장 요약 How Software Is Built 본문 중에서..4.1 Shooting at Moving TargetsWhen teaching someone to shoot at a moving target, you cannot give instructions about which direction to shoot, because the direction is constantly changing. Instead, you must give general instructions about aiming guns, instructions that can then be applied to a wide variety of moving targets. That's why the study of patterns of softwa.. 이전 1 다음