성태의 닷넷 이야기
홈 주인
모아 놓은 자료
프로그래밍
질문/답변
사용자 관리
사용자
메뉴
아티클
외부 아티클
유용한 코드
온라인 기능
MathJax 입력기
최근 덧글
[정성태] The Windows Registry Adventure #1: ...
[정성태] systemd for Developers I ; https:/...
[정성태] 엄밀히 object 타입의 인스턴스가 다른 타입으로 형변환 가능...
[정성태] 아래의 글에서 나오는 "Windows Application Pa...
[정성태] The history of calling conventions,...
[정성태] Secure and Deploy .NET Windows Form...
[정성태] Get Started with Milvus Vector DB i...
[정성태] cyberark/PipeViewer - A tool that...
[정성태] WinForms in a 64-Bit world – our st...
[정성태] 예제에서 SELECT_SQL도 내부적으로는 SqlCommand/...
글쓰기
제목
이름
암호
전자우편
HTML
홈페이지
유형
제니퍼 .NET
닷넷
COM 개체 관련
스크립트
VC++
VS.NET IDE
Windows
Team Foundation Server
디버깅 기술
오류 유형
개발 환경 구성
웹
기타
Linux
Java
DDK
Math
Phone
Graphics
사물인터넷
부모글 보이기/감추기
내용
<div style='display: inline'> <h1 style='font-family: Malgun Gothic, Consolas; font-size: 20pt; color: #006699; text-align: center; font-weight: bold'>PostgreSQL - ERROR: 22P02: malformed array literal: "..."</h1> <p> 오랜만에 postgreSQL에 테이블을 하나 만들고,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > name character varying[] (150) age integer </pre> <br /> 간단한 쿼리를 날렸더니,<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > INSERT INTO testtable(name,age) VALUES('a10f825a-71f9-4771-8e23-e810c3ac0efa', 5); </pre> <br /> 이런 오류가 발생합니다.<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > Server Error in '/' Application. ERROR: 22P02: malformed array literal: "a10f825a-71f9-4771-8e23-e810c3ac0efa" Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: Npgsql.NpgsqlException: ERROR: 22P02: malformed array literal: "a10f825a-71f9-4771-8e23-e810c3ac0efa" Source Error: Line 141: command.Parameters.Add(new NpgsqlParameter("P1", "a10f825a-71f9-4771-8e23-e810c3ac0efa")); Line 142: command.Parameters.Add(new NpgsqlParameter("P2", 5)); Line 143: int affected = command.ExecuteNonQuery(); Line 144: Line 145: command.Parameters.Clear(); Source File: D:\WebTest\WebSiteTest4\postgreSQLTest.aspx.cs Line: 143 Stack Trace: [NpgsqlException (0x80004005): ERROR: 22P02: malformed array literal: "fa60119b-b5d7-4b8b-bb2a-5b300b81c1c6"] Npgsql.<ProcessBackendResponses_Ver_3>d__a.MoveNext() in C:\projects\Npgsql2\src\Npgsql\NpgsqlState.cs:842 Npgsql.ForwardsOnlyDataReader.GetNextResponseObject() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:1163 Npgsql.ForwardsOnlyDataReader.GetNextRowDescription() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:1181 Npgsql.ForwardsOnlyDataReader.NextResult() in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:1373 Npgsql.ForwardsOnlyDataReader..ctor(IEnumerable`1 dataEnumeration, CommandBehavior behavior, NpgsqlCommand command, NotificationThreadBlock threadBlock, Boolean synchOnReadError) in C:\projects\Npgsql2\src\Npgsql\NpgsqlDataReader.cs:1030 Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:611 Npgsql.NpgsqlCommand.ExecuteNonQuery() in C:\projects\Npgsql2\src\Npgsql\NpgsqlCommand.cs:525 WebSiteTest.postgreSQLTest.Page_Load(Object sender, EventArgs e) in D:\WebTest\WebSiteTest4\postgreSQLTest.aspx.cs:143 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +226 System.Web.UI.Control.OnLoad(EventArgs e) +170 System.Web.UI.Control.LoadRecursive() +159 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3998 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4330.0 </pre> <br /> 왜냐하면, postgreSQL의 "character varying[]" 타입은 말 그대로 "string []"처럼 동작하기 때문입니다. 따라서, 해당 테이블의 칼럼 타입을 character varying으로 바꿔야 합니다. ^^;<br /> <br /> <pre style='margin: 10px 0px 10px 10px; padding: 10px 0px 10px 10px; background-color: #fbedbb; overflow: auto; font-family: Consolas, Verdana;' > name <span style='color: blue; font-weight: bold'>character varying (150)</span> age integer </pre> </p><br /> <br /><hr /><span style='color: Maroon'>[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]</span> </div>
첨부파일
스팸 방지용 인증 번호
1418
(왼쪽의 숫자를 입력해야 합니다.)