안녕하세요~
간만에 질문을 ^^;;
netitup=# create table test (a int[], b text[]); CREATE TABLE
netitup=# INSERT INTO test values('{1,2}','{"aa",2}'); INSERT 25371 1 netitup=# SELECT * from test; a | b -------+-------- {1,2} | {aa,2}
(1 row)
여기까지는 " 로 안감싸도 된다고 이해하겠습니다 -.-
netitup=# INSERT INTO test values('{1,2}','{"aa aa",2}'); INSERT 25372 1 netitup=# SELECT * from test; a | b -------+------------- {1,2} | {aa,2} {1,2} | {"aa aa",2} (2 rows)
netitup=# INSERT INTO test values('{1,20}','{"aa aa",2}'); INSERT 25373 1 netitup=# SELECT * from test; a | b --------+------------- {1,2} | {aa,2} {1,2} | {"aa aa",2} {1,20} | {"aa aa",2} (3 rows)
netitup=# INSERT INTO test values('{1,20}','{"aa aa",aa}'); INSERT 25374 1 netitup=# SELECT * from test; a | b --------+-------------- {1,2} | {aa,2} {1,2} | {"aa aa",2} {1,20} | {"aa aa",2} {1,20} | {"aa aa",aa} (4 rows)
어떨때 " 로 감싸지는지 이해는 할 수 있는데요..
모든 요소에 " 로 감싸게 하는 방법은 없는지요 -.-;;
응용프로그램에서 pgsql의 배열을 실제 배열로 파싱하려는데 저렇게 나와버리니 난감스럽네요 -_-;
요소 안에 , 라도 들어있으면 파싱하기가 여간 곤란스러워서 -_-; "," 로 문자열을 자르려니 숫자나 공백(특수문자 포함)없는 문자열들은 " 가 붙지 않고..
아주 그냥 죽겠습니다 =_=;
해결 방법이 꼭 좀 있었으면 -.-;;
그럼~ |