나는 열 location
에 파일의 폴더가있는 테이블을 가지고 있습니다. '/home/ubuntu/test'
및 name
열에는 파일 이름이 있습니다. 'test1.png'
.두 개의 열을 연결하고 그 중 하나를 postgresql의 결과로 바꿉니다.
location
열을 전체 경로로 바꾸고 싶습니다. 예 : '/home/ubuntu/test/test.png'
.
UPDATE experiment_11.microscope_image_files
SET location=(SELECT concat_ws('/', location::text, name::text)
FROM experiment_11.microscope_image_files);
을하지만, 나는 다음과 같은 오류 얻을 :
ERROR: more than one row returned by a subquery used as an expression
'UPDATE experiment_11.microscope_image_files SET location = concat_ws ('/', 위치 :: 텍스트, 이름 :: 텍스트)' – barbsan