'프로그램 사용/postgreSQL'에 해당되는 글 156건

  1. 2019.08.06 postgres \COPY
  2. 2019.06.28 union sql
  3. 2019.06.26 postgresql csv update
  4. 2019.06.25 postgresql csv import
  5. 2019.06.25 데이터베이스 테이블 복제하기(내용 없이)
  6. 2019.06.25 postgresql insert 속도 올리기
  7. 2019.06.25 postgresql ''
  8. 2019.06.25 postgresql truncate table
  9. 2019.06.24 libpq
  10. 2019.06.18 xsd to postgresql DDL

아..

예전에 된거 같아서 때려박아 보는데 relation이 없다고 나와서 급 멘붕..

postgres=# \COPY PERSON FROM 'person.csv' DELIMITER E'\t' CSV HEADER QUOTE E'\b' ;
오류:  "person" 이름의 릴레이션(relation)이 없습니다

 

원하던 글은 아니지만 다른글에서 원인 발견

copy는 생성된 테이블에 데이터를 넣어주는 매크로/함수인거지 테이블을 생성해주지 않음

[링크 : https://stackoverflow.com/questions/21018256/]

 

+

2019.09.02

\copy와 copy는 다른 명령이구나..

힌트:  COPY FROM 명령은 PostgreSQL 서버 프로세스가 한 파일을 읽어 처리합니다. 클라이언트 쪽에 있는 파일을 읽어 처리 하려면, psql의 \copy 내장 명령어를 사용하세요.

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

psql 테이블 목록보기  (0) 2019.08.08
pgfutter  (0) 2019.08.06
union sql  (0) 2019.06.28
postgresql csv update  (0) 2019.06.26
postgresql csv import  (0) 2019.06.25
Posted by 구차니

단순하게 두개의 테이블을 합쳐주는 역활을 하는 듯?

 

[링크 : http://www.postgresqltutorial.com/postgresql-union/]

 

+

이름이 서로 다른 항목을 union으로 합치니

postgresql에서 ?column? 으로 나와버려서 이름 바꾸려고 고군분투!

 

SELECT 'name' AS A FROM B

UNION

SELECT 'symbol' AS A FROM C

이런식으로 하면 AS 'A'가 컬럼 명으로 인식되서 나온다!

[링크 : https://social.msdn.microsoft.com/Forums/sqlserver/en-US/cae16db2-c08b-46bd-8b7b-d7941347ad3d/behaviour-of-union-when-select-column-names-differ-and-order-by-is-used?forum=transactsql]

 

[링크 : http://www.postgresqltutorial.com/postgresql-select-distinct/]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

pgfutter  (0) 2019.08.06
postgres \COPY  (0) 2019.08.06
postgresql csv update  (0) 2019.06.26
postgresql csv import  (0) 2019.06.25
데이터베이스 테이블 복제하기(내용 없이)  (0) 2019.06.25
Posted by 구차니

바로는 안되는 둣

 

[링크 : https://stackoverflow.com/questions/8910494/]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgres \COPY  (0) 2019.08.06
union sql  (0) 2019.06.28
postgresql csv import  (0) 2019.06.25
데이터베이스 테이블 복제하기(내용 없이)  (0) 2019.06.25
postgresql insert 속도 올리기  (0) 2019.06.25
Posted by 구차니

헤더가 들어가는 csv는 옵션이 좀더 붙네?

 

csv 포맷은

"col1","col2"

"13123","faskfjasldf"

 

psql에서 명령어는 아래와 같이 하면 된다.

\COPY persons FROM 'filename.csv' DELIMITER ',' CSV HEADER;

[링크 : http://www.postgresqltutorial.com/import-csv-file-into-posgresql-table/]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

union sql  (0) 2019.06.28
postgresql csv update  (0) 2019.06.26
데이터베이스 테이블 복제하기(내용 없이)  (0) 2019.06.25
postgresql insert 속도 올리기  (0) 2019.06.25
postgresql ''  (0) 2019.06.25
Posted by 구차니

postgresql에서 테스트 함

내용 복제하지 않고, 형태만 복사하기

create table bbbbbbb as select * from aaaaaaa where 1=2

[링크 : https://dmsrbdi123.tistory.com/12]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql csv update  (0) 2019.06.26
postgresql csv import  (0) 2019.06.25
postgresql insert 속도 올리기  (0) 2019.06.25
postgresql ''  (0) 2019.06.25
postgresql truncate table  (0) 2019.06.25
Posted by 구차니

아쉽게도(?) 쿼리나 시스템 보다는

해당 table의 log를 끄는게 더 효율적인듯(트랜잭션 로그 끄는건가?)

 

[링크 : https://gist.github.com/valyala/ae3cbfa4104f1a022a2af9b8656b1131]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql csv import  (0) 2019.06.25
데이터베이스 테이블 복제하기(내용 없이)  (0) 2019.06.25
postgresql ''  (0) 2019.06.25
postgresql truncate table  (0) 2019.06.25
libpq  (0) 2019.06.24
Posted by 구차니

 

[링크 : https://www.postgresql.org/docs/9.3/sql-syntax-lexical.html]

 

+

2019.08.24

왜 검색해둔거지? =0=

일단은 " 로는 에러가 나고 ' 로 해야지 되는게 대부분이라.. 일단은 문자열을 위한 문법에서는 '만 허용하는걸로..

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

데이터베이스 테이블 복제하기(내용 없이)  (0) 2019.06.25
postgresql insert 속도 올리기  (0) 2019.06.25
postgresql truncate table  (0) 2019.06.25
libpq  (0) 2019.06.24
xsd to postgresql DDL  (0) 2019.06.18
Posted by 구차니

한번에 테이블 내용 싹다 비우는 좋은 명령어!

(근데 rm -rf / 의 기운이 느껴지는건 기분탓인가...)

 

[링크 : https://www.postgresql.org/docs/9.1/sql-truncate.html]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql insert 속도 올리기  (0) 2019.06.25
postgresql ''  (0) 2019.06.25
libpq  (0) 2019.06.24
xsd to postgresql DDL  (0) 2019.06.18
postgresql dbms 설정  (0) 2019.06.14
Posted by 구차니

c용 postgresql 라이브러리

libpg-dev를 설치하면 되려나?

 

[링크 : https://www.postgresql.org/docs/9.1/libpq-example.html]

[링크 : https://www.postgresql.org/docs/9.5/libpq-connect.html]

[링크 : http://www.askyb.com/cpp/c-postgresql-example/] cpp class

 

 

+

sudo apt-get install libpq-dev

vi pg_exam.c

#include <postgresql/libpq-fe.h>

gcc pg_exam.c -lpq

./a.out "dbname=postgres host=localhost user=postgres password=postgres"

[링크 : https://www.postgresql.org/docs/8.3/libpq-build.html]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql ''  (0) 2019.06.25
postgresql truncate table  (0) 2019.06.25
xsd to postgresql DDL  (0) 2019.06.18
postgresql dbms 설정  (0) 2019.06.14
pgadmin dashboard 살려내기  (0) 2019.06.13
Posted by 구차니

별다르게 빌드 안하고 이미 빌드 된 녀석으로 바로 실행해도 잘 된다.

java -classpath ./xsd2pgschema.jar xsd2pgschema --xsd xsd_file > ddl.psql

[링크 : https://sourceforge.net/projects/xsd2pgschema/]

'프로그램 사용 > postgreSQL' 카테고리의 다른 글

postgresql truncate table  (0) 2019.06.25
libpq  (0) 2019.06.24
postgresql dbms 설정  (0) 2019.06.14
pgadmin dashboard 살려내기  (0) 2019.06.13
postresql backup & recovery  (0) 2019.06.12
Posted by 구차니