'프로그램 사용'에 해당되는 글 2258건

  1. 2019.07.04 vi gg=G와 set ts
  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 expat 다시 사용..
  10. 2019.06.24 libpq
프로그램 사용/vi2019. 7. 4. 16:35

어라.. gg=G 하니까

무조건 8칸에 맞는 탭으로 강제로 맞춘다 -_-

 

:set ts=4

를 해서 gg=G 하면 두개 탭이 들어가고

 

:set ts=8

를 해서 gg=G 하면 하나의 탭만 들어간다.

 

어떻게 손을 봐야하지?

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

vim 색상 바꾸기(colorscheme)  (0) 2021.01.20
vi 에서 매칭되는 갯수 확인하기  (0) 2019.12.18
vi 검색 취소하기  (0) 2019.06.04
vi 여러개 파일 편집하기(동시 x)  (0) 2017.09.16
vi 반복 입력  (0) 2017.09.16
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 구차니

그나저나 망할(?) &lt를 <로 바꿔버리는 바람에 귀찮아지네...

특수문자를 건드리지 않고 바이패스 하는법 없으려나?

 

#include <stdio.h>
#include <string.h>
#include <expat.h>

#ifdef XML_LARGE_SIZE
# if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
#  define XML_FMT_INT_MOD "I64"
# else
#  define XML_FMT_INT_MOD "ll"
# endif
#else
# define XML_FMT_INT_MOD "l"
#endif

#ifdef XML_UNICODE_WCHAR_T
# define XML_FMT_STR "ls"
#else
# define XML_FMT_STR "s"
#endif

#define BUFFSIZE        8192

char Buff[BUFFSIZE];
char Buff_con[BUFFSIZE];

int Depth;
XML_Parser p;

static void XMLCALL
start(void *data, const XML_Char *el, const XML_Char **attr)
{
  int i;
  (void)data;

  for (i = 0; i < Depth; i++)
    printf("\t");

  printf("<%" XML_FMT_STR, el);

  for (i = 0; attr[i]; i += 2) {
    printf(" %" XML_FMT_STR "=\"%" XML_FMT_STR "\"", attr[i], attr[i + 1]);
  }

  printf(">");
//  printf(">\n");
  Depth++;
}

static void XMLCALL
data(void *data, const XML_Char *s, int len)
{
        if(len > 0)
        {
        memcpy(Buff_con, s, len);
        Buff_con[len] = '\0';
        printf("%s", Buff_con);
        }
}

static void XMLCALL
end(void *data, const XML_Char *el)
{
  int i;
  (void)data;
  (void)el;

//  for (i = 0; i < Depth; i++)
//    printf("\t");

  printf("</%" XML_FMT_STR, el);
  printf(">");
//  printf(">\n");
  Depth--;
}

int
main(int argc, char *argv[])
{
//  XML_Parser p = XML_ParserCreate(NULL);
  p = XML_ParserCreate(NULL);
  (void)argc;
  (void)argv;

  if (! p) {
    fprintf(stderr, "Couldn't allocate memory for parser\n");
    exit(-1);
  }

  XML_SetElementHandler(p, start, end);
  XML_SetCharacterDataHandler(p, data);
  XML_SetParamEntityParsing(p, XML_PARAM_ENTITY_PARSING_NEVER);

  for (;;) {
    int done;
    int len;

    len = (int)fread(Buff, 1, BUFFSIZE, stdin);
    if (ferror(stdin)) {
      fprintf(stderr, "Read error\n");
      exit(-1);
    }
    done = feof(stdin);

    if (XML_Parse(p, Buff, len, done) == XML_STATUS_ERROR) {
      fprintf(stderr,
              "Parse error at line %" XML_FMT_INT_MOD "u:\n%" XML_FMT_STR "\n",
              XML_GetCurrentLineNumber(p),
              XML_ErrorString(XML_GetErrorCode(p)));
      exit(-1);
    }

    if (done)
      break;
  }
  XML_ParserFree(p);
  return 0;
}

 

start / end

[링크 : https://github.com/libexpat/libexpat/blob/master/expat/examples/elements.c]

 

data

[링크 : https://stackoverflow.com/questions/609376/geting-xml-data-using-xml-parser-expat]

 

 

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

GPX TCX 포맷  (0) 2013.06.22
Javascript DOM API / XML  (2) 2010.07.13
[해결중] expat 버퍼 관련 문제  (0) 2010.05.25
expat으로 smi 자막파일 파싱은 불가?  (0) 2010.05.03
SAX (Simple API for XML)  (0) 2010.04.23
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 구차니