'2019/10/29'에 해당되는 글 2건

  1. 2019.10.29 postgresql ctid
  2. 2019.10.29 coalesce() / isnull()

ctid는 typle id로 물리적 위치를 나타내는데 update 하면 바뀐다고 한다(oracle 등은 고정된 순서로 유지되는 듯)

[링크 : https://www.postgresdba.com/bbs/board.php?bo_table=B12&wr_id=63]

 

ctid

The physical location of the row version within its table. Note that although the ctid can be used to locate the row version very quickly, a row's ctid will change each time it is updated or moved by VACUUM FULL. Therefore ctid is useless as a long-term row identifier. The OID, or even better a user-defined serial number, should be used to identify logical rows.

[링크 : https://www.postgresql.org/docs/8.2/ddl-system-columns.html]

Posted by 구차니

postgresql 에서는 isnull 대신 coalesce()를 지원한다고 한다.

용도는... full outer join 에서 한쪽이 null일 경우 반대쪽 key를 사용하는 용도 정도?

그 외에는 어떤 용도가 있을지 모르겠다.

 

 

설명만 봐서는.. nullif가 다른 dbms의 명령어와 같아 보이는데

coalesce는 value [,...] 이기 때문에 n개에 대해서 지원을 하는 것으로 보인다.

COALESCE(value [, ...])
NULLIF(value1, value2)

[링크 : https://www.postgresql.org/docs/9.5/functions-conditional.html]

[링크 : http://www.postgresqltutorial.com/postgresql-coalesce/]

 

[링크 : https://xshine.tistory.com/205]

[링크 : https://joeylee.tistory.com/15]

Posted by 구차니