일단~은

AES/CBC/PKCS5PADDING이 기본이라고 보면 될 듯?

 

Encrypt/decrypt data using the cipher method specified by type. The syntax of the type string is:

where algorithm is one of:

  • bf — Blowfish

  • aes — AES (Rijndael-128, -192 or -256)

and mode is one of:

  • cbc — next block depends on previous (default)

  • ecb — each block is encrypted separately (for testing only)

and padding is one of:

  • pkcs — data may be any length (default)

  • none — data must be multiple of cipher block size

[링크 : https://www.postgresql.org/docs/9.6/pgcrypto.html]

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

sql over() partition by  (0) 2019.11.28
pg_tables, pg_sequences  (0) 2019.11.28
sql TO_CHAR()  (0) 2019.11.23
sql where like %와 _  (0) 2019.11.22
split_part() 에서 나눠지지 않을 경우 없는 막기  (0) 2019.11.15
Posted by 구차니

 

 

[링크 : https://it.toolbox.com/question/padding-zeros-for-a-sequence-080714]

[링크 : https://stackoverflow.com/questions/6862766/how-to-create-postgresql-leading-zero-sequence-zerofill]

[링크 : https://w3resource.com/PostgreSQL/lpad-function.php]

[링크 : https://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_db&wr_id=131902]

 

+

mysql zerofill 이라는 옵션제공(table 생성시)

[링크 : https://m.blog.naver.com/luvtoma/221179414916]

 

단, 표시가 다르게 될 뿐이지, 실제 저장되는 데이터 사이즈가 달라지는건 아니라는 이야기

[링크 : https://www.phpschool.com/gnuboard4/bbs/board.php?bo_table=qna_db&wr_id=169515&page=638]

 

oracle에서는 LPAD나 RPAD혹은 TO_CHAR로 하라는거 봐서는

mysql에서만 제공하는 특수한 기능으로 보인다.

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

mariadb c# connector  (0) 2021.10.22
HeidiSQL  (2) 2021.08.18
mysql-dump compatible 함정 -_-  (0) 2019.09.04
mysql / unix-socket  (0) 2019.09.04
mysql exists  (0) 2019.07.05
Posted by 구차니

어떻게 보면.. sprintf 역활을 하는 함수라고 하면 되려나?

특정 자릿수로 제한하거나 공백에 0을 채우거나 할때

 

SELECT TO_CHAR(value, '00000')

이렇게 하면 value가 5자리를 넘지 않을 경우

00001~99999 까지 자릿수 유지하면서 출력한다.

[링크 : https://www.postgresql.org/docs/9.3/functions-formatting.html]

Posted by 구차니

솔찍히 다시 원점으로 돌아가서

처음부터 봐야 할 느낌.. branch 오가거나 특정 revision 가거나 하는거

막 혼동이 온다...

 

[링크 : https://blog.outsider.ne.kr/820]

Posted by 구차니

%는 * 의미

_는 ? 의미 로 사용이 가능하다.

[링크 : https://www.w3schools.com/sql/sql_wildcards.asp]

Posted by 구차니

git은 여전히 어렵다... ㅠㅠ

git의 HEAD에서 몇번째 전으로 돌아가서 그걸 다시 올리거나

[링크 : https://mytory.net/archives/10078]

 

그게 아니라면 특정 버전까지를 전부 지우는 것도 가능 한듯?

[링크 :https://medium.com/nonamedeveloper/초보용-git-되돌리기-reset-revert-d572b4cb0bd5]

 

 

+

stash 영역이란걸 알아두면 편할 듯?

리비전 오갈때 잠시 저장해 둘 수 있는 곳

[링크 : https://medium.com/@pks2974/자주-사용하는-기초-git-명령어-정리하기-533b3689db81]

Posted by 구차니

1123.0

이라는 숫자가 있고

1123 이 있는데

split_part(num, '.', 2)를 하면 1123은 0으로 나누어지지만

1123은 ''으로 나오기에 미리 값을 확인하고 null로 case 문 처리 해야 할 듯

 

ASE WHEN version LIKE '%-%'
     THEN SPLIT_PART(version, '-', 2)::int
     ELSE 0 END

[링크 : https://stackoverflow.com/questions/45766644/substituting-value-in-empty-field-after-using-split-part]

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

sql TO_CHAR()  (0) 2019.11.23
sql where like %와 _  (0) 2019.11.22
postgres table schema comment 달기  (0) 2019.11.13
with in sql  (0) 2019.11.11
where not in 에서는 null 값을 조심하자  (0) 2019.11.11
Posted by 구차니

pgadmin 프로그램 버전에서 테이블 클릭시 create table 명령과 함께 구조가 나오는데 거기에 주석을 다는 방법

웹 버전의 pgadmin(윈도우) 에서는 comment를 어떻게 볼수 있는지 모르겠네..

 

 

아무튼 결론

테이블을 만들고 나서 comment on column table.column_name is 'comment' 식으로 달면된다.

create table session_log 

   userid int not null, 
   phonenumber int
); 

comment on column session_log.userid is 'The user ID';
comment on column session_log.phonenumber is 'The phone number including the area code';

 

[링크 : http://lnk2580.blogspot.com/2014/12/db-postgresql-comment.html]

[링크 : https://stackoverflow.com/.../adding-comment-to-column-when-i-create-table-in-postgresql]

 

+

코멘트 없애는건 빈 코멘트를 쓰면된다.

Only one comment string is stored for each object, so to modify a comment, issue a new COMMENT command for the same object. To remove a comment, write NULL in place of the text string. Comments are automatically dropped when their object is dropped.

 

COMMENT ON COLUMN my_table.my_column IS 'Employee ID number';

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

[링크 : http://www.dbatodba.com/db2/db2-comment/]

 

+

테이블 컬럼의 코멘트는 웹 버전보다 리눅스 어플리케이션 버전이 더 보기 편하네?

[링크 : https://dataedo.com/kb/tools/pgadmin/how-to-view-and-edit-table-and-column-comments]

Posted by 구차니

걍.. with 변수명 as (select ...)

하고 쓰면 되네? 일종의 임시 테이블로 쓰이는구나..

[링크 : https://thebook.io/006696/part01/ch07/02/]

Posted by 구차니

null이 하나라도 있으면

and value != NULL 조건이 되어서

정상적으로 걸러지지 않는 듯

[링크 : https://doorbw.tistory.com/222]

Posted by 구차니