[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-05(UTC)"],[],[],null,["# Connect psql to a PostgreSQL-dialect database\n\nThis page explains how to connect `psql` to a PostgreSQL-dialect database in Spanner.\n`psql` is the command-line front end to PostgreSQL.\n\n1. Ensure that PGAdapter is running on the same machine as the `psql` command.\n\n For more information, see [Start PGAdapter](/spanner/docs/pgadapter-start).\n2. In a terminal window, start `psql` and specify `localhost` as the database server host.\n\n - Optionally specify a port number if PGAdapter is configured to listen on a port other than the default PostgreSQL port (5432).\n - Optionally specify one or more commands to send to the database or driver (for example, the JDBC driver). For each occurrence of the `-c` option, you can specify a single command or a batch of commands separated by semicolons (;). For more information, see [psql command-line tool](/spanner/docs/psql-commands).\n\n `psql -h localhost [-p `\u003cvar translate=\"no\"\u003ePORT\u003c/var\u003e`] [-c \"`\u003cvar translate=\"no\"\u003eCOMMAND\u003c/var\u003e`; ...\"] ...`\n3. Optional: Verify that `psql` successfully connected to a PostgreSQL-dialect database\n by submitting the following query:\n\n `SELECT 1::bigint;`\n\n This query is incompatible with GoogleSQL-dialect databases.\n\nWhat's next\n-----------\n\n- Learn about [PGAdapter](/spanner/docs/pgadapter).\n- See the supported `psql` commands in [psql command-line tool](/spanner/docs/psql-commands)."]]