Tagging
Try bookmarklet. Easy tagging.
Do you want to delete?
Do you want to modify?
  • LINKTAG
  • New
  • Tag
  • Comment
  • Tag, pk
Sign in

pk

it ops db id pk

๐Ÿ”‘ Awesome Identifiers

wono | discuss |
it ops db postgresql pk

PostgreSQL generate unique sorted IDs for timestamps

PostgreSQL generate unique sorted IDs for timestamps - snowflake.sql
wono | discuss |
it ops db postgresql pk

Choosing Primary Key Type in Postgres

In relational database design one of the key decisions is choosing the right primary key type for tables. In this post I am talking about surrogate or synthetic primary keys. They are called surrogโ€ฆ
wono | discuss |
it ops db pk uuid

๋ถ„์‚ฐํ™˜๊ฒฝ์—์„œ DB ๊ธฐ๋ณธํ‚ค(PK)๋Š” ์–ด๋–ค ID ์ƒ์„ฑ ์ „๋žต์œผ๋กœ ๋งŒ๋“ค์–ด์•ผํ• ๊นŒ? (UUID,ULID,TSID...)

๋ณดํ†ต ๊ฐœ๋ฐœ ํŽธ์˜์„ฑ์„ ์œ„ํ•ด Oracle์˜ Sequence, MySQL์˜ auto_increment ๋กœ ์ˆซ์ž๋ฅผ 1์”ฉ ์ฆ๊ฐ€์‹œํ‚ค๋Š” ๊ฒƒ์œผ๋กœ ๋งŒ๋“ ๋‹ค. ์ด๊ฒƒ์€ ์–ด๋–ค ๋ฌธ์ œ์ ์ด ์žˆ์„๊นŒ? ์™ธ๋ถ€์—์„œ ํ•ด๋‹น ์‹œ์Šคํ…œ PK๋ฅผ ์˜ˆ์ธกํ•˜๊ธฐ ์‰ฌ์›Œ์ ธ์„œ SQL Injection ๋ฌธ์ œ Sequence, auto_increment๋Š” ์ค‘์•™ ์ง‘์ค‘์‹์œผ๋กœ ๊ฐ’์„ ์ƒ์„ฑํ•˜๋Š” ๋ฐฉ์‹์ด๋ฏ€๋กœ DB์— ์˜์กด์ ์ด๊ฒŒ ๋˜์–ด ํ™•์žฅ์„ฑ์ด ์ œํ•œ๋˜๋Š” ๋ฌธ์ œ ์„œ๋น„์Šค ํญํ’์„ฑ์žฅ ์‹œ, ID ๊ณ ๊ฐˆ๋˜๋Š” ๋ฌธ์ œ (BIGINT ์ตœ๋Œ“๊ฐ’์€ 4,294,967,295 ์ด๊ณ , unsigned BIGINT๋ผ๋ฉด 18,446,744,073,709,551,615) ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ๋ณ€๊ฒฝ์˜ ์–ด๋ ค์›€ DB๊ฐ€ 2๋Œ€ ์ด์ƒ์ผ ๋•Œ ์ค‘๋ณต ๋ฌธ์ œ ๐Ÿ’ก MySQL 5.7 ์ดํ•˜ ๋ฒ„์ „์—์„œ๋Š” AUTO_INCREMENT counter ๊ฐ’์„ ๋ฉ”๋ชจ๋ฆฌ์—..
wono | discuss |
it dev db pk full

What to do if the auto-increment value reaches its limit?

wono | discuss |
© 2025. LINKTAG.ORG. Help Feedback Privacy Terms