일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- ubuntu
- postgresql
- Eclipse
- ngui
- Unity
- dataframe
- conda
- c++11
- SVN
- List
- 배열
- sqlite
- FIND
- mysql
- C++
- autovacuum
- SSH
- DROP
- python
- Shader
- boost
- if
- expect
- awk
- with
- pi
- null
- 쉘
- sql
- pandas
- Today
- Total
목록postgresql (18)
その先にあるもの…
psycopg2를 사용하여 쿼리를 가져오면 table을 columns 이름들이 없이 데이터만 받아온다. import pandas as pd ... df = pd.read_sql( 'select * from table' , con = conn) conn.close()
update table-name set field = case value when 1 then 10 when 2 then 20 when 3 then 30 when 4 then 40 when 5 then 50 end; public.function() ~~~ begin case value when 1 then return 10 when 2 then return 20 when 3 then return 30 when 4 then return 40 when 5 then return 50 end case; end;
함수 목록 확인 \df \df 함수 이름 함수 내용 보기 \df+ 함수 이름 kldp.org/node/94203
$ 유저 접속 psql -U 유저이름 -d db이름 PGPASSWORD=패스워드 psql -U 유저이름 -d db이름 $ 쿼리 실행 PGPASSWORD=패스워드 psql -U 유저이름 -d db이름 -c 'select * from table' $ 파일에 저장되어 있는 쿼리 실행 PGPASSWORD=패스워드 psql -U 유저이름 -d db이름 -f query.sql PGPASSWORD=패스워드 psql -U 유저이름 -d db이름 < query.sql $원격지 database접속 psql -h 000.000.000.000 -U 유저이름 -d db이름
select * from pg_tables;