에러는 아래와 같이 났고..

오류:  date 자료형 대한 잘못된 입력: "NULL"

 

일단은 아래의 방식으로 회피, quote 쪽은 영향을 안주는 듯 하나 테스트는 안해봤음

DELIMITER E',' CSV QUOTE '"' NULL as 'NULL';

[링크 : https://www.postgresql.org/message-id/4938938A.2090409@dbginc.com]

[링크 : https://stackoverflow.com/questions/40428417/postgres-csv-date-null-import-error]

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

postgresql.conf 설정사항들  (0) 2019.09.06
postgresql copy from csv , iso8859-1  (0) 2019.09.05
postgresql unknown pseudo-type  (0) 2019.09.05
postgresql schema 내의 테이블 이동하기  (0) 2019.09.05
pgadmin over ssh  (0) 2019.09.03
Posted by 구차니
Linux2019. 9. 5. 13:34

소리 절로나오는 상황 -_-

 

cut -d'|' -f2- infile > outfile2 && mv outfile2 file

[링크 : https://stackoverflow.com/questions/16448153/awk-how-to-delete-first-column-with-field-separator]

 

여러개 필드를 날릴려면 -f2,4 이런식으로 리스트로 적어주면 된다.

       -f, --fields=LIST
              select only these fields;  also print any line that contains no delimiter character, unless the -s option is specified

'Linux' 카테고리의 다른 글

screen 명령어와 함께 실행하기  (0) 2019.09.23
screen 스크롤하기  (0) 2019.09.23
awk csv  (0) 2019.09.05
awk 변수 지정  (0) 2019.09.02
awk 치환(삭제)  (0) 2019.09.02
Posted by 구차니
Linux2019. 9. 5. 12:59

awk로 csv를 처리하려면.. 구분자를 , 로 하고 손을 봐야 하는데

영 매끄럽진 않네..

 

[링크 : https://www.joeldare.com/wiki/using_awk_on_csv_files]

'Linux' 카테고리의 다른 글

screen 스크롤하기  (0) 2019.09.23
csv에서는 awk 보단 cut  (0) 2019.09.05
awk 변수 지정  (0) 2019.09.02
awk 치환(삭제)  (0) 2019.09.02
tail과 cat 합치기  (0) 2019.09.02
Posted by 구차니

9.0 이후 부터 unknown을 쓸수 없게 되었다는데 도대체 이런 타입을 어떻게 만든거지?

 

unknown became a pseudo-type with commit d8d32d9a5. Creation of tables with unknown columns was disabled in commit 1e7c4bb004. Both commits were in January 2017, long after 9.0

[링크 : https://dba.stackexchange.com/questions/241870/postgres-column-type-unknown/241872#241872]

 

일단은.. text로 바꾸어주면 되려나?

[링크 : https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1e7c4bb...]

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

postgresql copy from csv , iso8859-1  (0) 2019.09.05
postgresql copy from csv, date null  (0) 2019.09.05
postgresql schema 내의 테이블 이동하기  (0) 2019.09.05
pgadmin over ssh  (0) 2019.09.03
psql 명령어  (0) 2019.09.03
Posted by 구차니

스키마 자체를 변경해서 어떻게 할 수 있을줄 알았는데 그건 안되고

테이블에 해당 schema 정보가 있기 때문에

table 별로 이동을 시켜주어야 한다.

 

동일 데이터베이스내면 그나마 다행인데.. 그게 아니라면 pg_dump로 뺴내서 데이터베이스간에 옮겨야 한다.

[링크 : https://www.codeproject.com/Questions/1020013/how-to-copy-table-one-database-to-another-database]

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

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

postgresql copy from csv, date null  (0) 2019.09.05
postgresql unknown pseudo-type  (0) 2019.09.05
pgadmin over ssh  (0) 2019.09.03
psql 명령어  (0) 2019.09.03
postgresql copy 와 \copy  (0) 2019.09.03
Posted by 구차니
Linux/Ubuntu2019. 9. 4. 15:18

설정이 꼬였나.. 기존에는 바로 된거 같은데 안되네?

 

$ sudo vim /etc/apache2/apache2.conf

Include /etc/phpmyadmin/apache.conf

$ sudo service apache2 restart

[링크 : https://tistory.woobi.org/52]

'Linux > Ubuntu' 카테고리의 다른 글

우분투 화상 키보드 끄기  (0) 2019.12.21
mx linux - xfce + debian  (0) 2019.10.14
ubuntu 18.04 wayland와 ubuntu session  (0) 2019.08.28
ubuntu virtual desktop  (0) 2019.08.28
ubuntu 18.04 fsck 예약(?)  (0) 2019.08.27
Posted by 구차니

compatible을 넣는다고 해서 해당 compatible mode의 주석처리나 변수형이 바뀌진 않는다.. 인가?

 

--compatible=name

Produce output that is more compatible with other database systems or with older MySQL servers. The value of name can be ansi, mysql323,mysql40, postgresql, oracle, mssql, db2, maxdb, no_key_options, no_table_options, or no_field_options. To use several values, separate them by commas. These values have the same meaning as the corresponding options for setting the server SQL mode. See Section 5.1.10, “Server SQL Modes”.

This option does not guarantee compatibility with other servers. It only enables those SQL mode values that are currently available for making dump output more compatible. For example, --compatible=oracle does not map data types to Oracle types or use Oracle comment syntax.

[링크 : https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html]

[링크 : https://dev.mysql.com/doc/refman/5.5/en/sql-mode.html]

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

HeidiSQL  (2) 2021.08.18
sql zerofill  (0) 2019.11.25
mysql / unix-socket  (0) 2019.09.04
mysql exists  (0) 2019.07.05
mysql timestamp 1분 이내 매치하기  (0) 2018.12.21
Posted by 구차니

그냥 root 권한은 유닉스 소켓으로 접속하게 되어있어서

sudo 를 통해 권한을 변경해서 접속하면 된다고... -_-

 

$ sudo mysql -u root

[링크 : https://stackoverflow.com/questions/39281594/error-1698-28000-access-denied-for-user-rootlocalhost]

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

sql zerofill  (0) 2019.11.25
mysql-dump compatible 함정 -_-  (0) 2019.09.04
mysql exists  (0) 2019.07.05
mysql timestamp 1분 이내 매치하기  (0) 2018.12.21
mysql join과 필드명 변경하기  (0) 2018.12.21
Posted by 구차니

거창한건 아니고 리눅스에서 -L 옵션을 통해 ssh의 포트포워딩으로 

localhost 포트를 통해 접속하는 것. 나름 속도도 잘나오고 좋네

 

[링크 :  https://www.tecmint.com/create-ssh-tunneling-port-forwarding-in-linux/]

[링크 :  https://www.linode.com/.../how-to-access-postgresql-database-remotely-using-pgadmin-on-windows/]

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

postgresql unknown pseudo-type  (0) 2019.09.05
postgresql schema 내의 테이블 이동하기  (0) 2019.09.05
psql 명령어  (0) 2019.09.03
postgresql copy 와 \copy  (0) 2019.09.03
pg_restore  (0) 2019.09.03
Posted by 구차니

\dt 밖에 기억을 못하고 살아서 좀더 봐야 할 듯

 

정보보기
  (옵션: S = 시스템 개체 표시, + = 추가 상세 정보)
  \d[S+]                 테이블, 뷰 및 시퀀스 목록
  \d[S+]  NAME           테이블, 뷰, 시퀀스 또는 인덱스 설명
  \da[S]  [PATTERN]      집계 함수 목록
  \dA[+]  [PATTERN]      접근 방법 목록
  \db[+]  [PATTERN]      테이블스페이스 목록
  \dc[S+] [PATTERN]      문자셋 변환자 목록
  \dC[+]  [PATTERN]      자료형 변환자 목록
  \dd[S]  [PATTERN]      다른 곳에서는 볼 수 없는 객체 설명을 보여줌
  \dD[S+] [PATTERN]      도메인 목록
  \ddp    [PATTERN]      기본 접근권한 목록
  \dE[S+] [PATTERN]      외부 테이블 목록
  \det[+] [PATTERN]      외부 테이블 목록
  \des[+] [PATTERN]      외부 서버 목록
  \deu[+] [PATTERN]      사용자 매핑 목록
  \dew[+] [PATTERN]      외부 데이터 래퍼 목록
  \df[anptw][S+] [PATRN] [agg/normal/procedures/trigger/window] 함수 목록
  \dF[+]  [PATTERN]      텍스트 검색 구성 목록
  \dFd[+] [PATTERN]      텍스트 검색 사전 목록
  \dFp[+] [PATTERN]      텍스트 검색 파서 목록
  \dFt[+] [PATTERN]      텍스트 검색 템플릿 목록
  \dg[S+] [PATTERN]      롤 목록
  \di[S+] [PATTERN]      인덱스 목록
  \dl                    큰 개체 목록, \lo_list 명령과 같음
  \dL[S+] [PATTERN]      프로시져 언어 목록
  \dm[S+] [PATTERN]      materialized 뷰 목록
  \dn[S+] [PATTERN]      스키마 목록
  \do[S]  [PATTERN]      연산자 목록
  \dO[S+] [PATTERN]      collation 목록
  \dp     [PATTERN]      테이블, 뷰 및 시퀀스 액세스 권한 목록
  \drds [PATRN1 [PATRN2]] 데이터베이스별 롤 설정 목록
  \dRp[+] [PATTERN]      복제 발행 목록
  \dRs[+] [PATTERN]      복제 구독 목록
  \ds[S+] [PATTERN]      시퀀스 목록
  \dt[S+] [PATTERN]      테이블 목록
  \dT[S+] [PATTERN]      데이터 형식 목록
  \du[S+] [PATTERN]      롤 목록
  \dv[S+] [PATTERN]      뷰 목록
  \dx[+]  [PATTERN]      확장 모듈 목록

  \dy     [PATTERN]      이벤트 트리거 목록
  \l[+]   [PATTERN]      데이터베이스 목록
  \sf[+]  함수이름       함수 정의 보기
  \sv[+] 뷰이름          뷰 정의 보기
  \z      [PATTERN]      \dp와 같음

 

전체 스키마 목록

\dn

[링크 : https://tableplus.com/blog/2018/04/postgresql-how-to-list-all-schemas.html]

 

기본은 public schema만 보도록 되어있어서

show search_path;를 통해 현재 설정된 것을 보고

set search_path = newschema;를 통해서 newschema를 기본으로 보게 된다(\dt 등의 결과가 영향을 받음)

[링크 : https://www.mkyong.com/database/postgresql-how-to-change-default-schema/]

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

postgresql schema 내의 테이블 이동하기  (0) 2019.09.05
pgadmin over ssh  (0) 2019.09.03
postgresql copy 와 \copy  (0) 2019.09.03
pg_restore  (0) 2019.09.03
postgresql working directory  (0) 2019.09.02
Posted by 구차니