From 168671bc145498be019b717056c3ea34358e64e2 Mon Sep 17 00:00:00 2001 From: art Date: Tue, 30 Jun 2026 11:16:52 +0900 Subject: [PATCH] =?UTF-8?q?fix(posts):=20PostgreSQL=20untyped=20NULL=20?= =?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20500=20+=20category=5Fid?= =?UTF-8?q?=20UPDATE=20=EB=88=84=EB=9D=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit listPublishedKeyset SQL에서 #{categoryId}/#{cursorCreatedAt} IS NULL 조건 사용 시 PostgreSQL이 바인드 파라미터 타입을 결정하지 못해 PSQLException: could not determine data type of parameter $1 → 500 발생. 파라미터에 ::bigint / ::timestamptz 명시 캐스트 추가로 수정. update() SQL에서 category_id = #{categoryId} 컬럼 누락 — 카테고리 변경이 DB에 반영되지 않는 데이터 정합성 버그 함께 수정. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01K3FeMrbtxfTScjrwUukyHD --- .../java/com/pandoli365/bibimbap/mapper/PostsMapper.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/pandoli365/bibimbap/mapper/PostsMapper.java b/src/main/java/com/pandoli365/bibimbap/mapper/PostsMapper.java index 9c210e5..119700a 100644 --- a/src/main/java/com/pandoli365/bibimbap/mapper/PostsMapper.java +++ b/src/main/java/com/pandoli365/bibimbap/mapper/PostsMapper.java @@ -41,10 +41,10 @@ public interface PostsMapper { JOIN post_categories c ON c.id = p.category_id WHERE p.status = 'PUBLISHED' AND p.is_delete = false - AND (#{categoryId} IS NULL OR p.category_id = #{categoryId}) + AND (#{categoryId}::bigint IS NULL OR p.category_id = #{categoryId}::bigint) AND ( - #{cursorCreatedAt} IS NULL - OR (p.created_at, p.id) < (#{cursorCreatedAt}, #{cursorId}) + #{cursorCreatedAt}::timestamptz IS NULL + OR (p.created_at, p.id) < (#{cursorCreatedAt}::timestamptz, #{cursorId}::bigint) ) ORDER BY p.created_at DESC, p.id DESC LIMIT #{limit} @@ -119,7 +119,8 @@ public interface PostsMapper { @Update(""" UPDATE posts - SET title = #{title}, + SET category_id = #{categoryId}, + title = #{title}, body_markdown = #{bodyMarkdown}, body_sanitized_html = #{bodySanitizedHtml}, link_url = #{linkUrl},