SQL Shell (psql) 에서 명령
postgreql 처음 써보는 데 사용한 명령어 및 커넥션 설정 정리
psql
psql commands1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| CREATE DATABASE student;
CREATE USER sung WITH PASSWORD '1234';
GRANT ALL PRIVILEGES ON DATABASE student TO sung;
\c student sung
\l
\d \dt
\d "User"
select * from "User";
|
connection
application.properties1 2 3 4 5 6 7
| spring.datasource.url=jdbc:postgresql://localhost:5432/student spring.datasource.username=sung spring.datasource.password=1234 spring.jpa.hibernate.ddl-auto=create-drop spring.jpa.show-sql=true spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect spring.jpa.properties.hibernate.format_sql=true
|
jdbc
pgAdmin
참고