could not determine data type of parameter $2

곽태욱·2023년 2월 5일
0

Before

SELECT *
FROM table1
WHERE column1 = $1
  AND (
    $2 IS NULL
    OR column2 = $2
  );

After

SELECT *
FROM table1
WHERE column1 = $1
  AND (
    $2::text IS NULL
    OR column2 = $2::text
  );
profile
이유와 방법을 알려주는 메모장 겸 블로그 (Frontend, AI, 경제, 책)

0개의 댓글