๐Ÿ‘จ‍๐Ÿ’ป kimtongting
PostgreSQL Sequence ์ƒ์„ฑ / postgreSQL ์‹œํ€€์Šค ์ƒ์„ฑ
๐Ÿ’พDatabase/PostgreSQL 2020. 8. 31. 03:52

#์‹œํ€€์Šค ์ƒ์„ฑ create sequence TB_Board_SEQ start with 1 increment by 1 cache 10; #์‹œํ€€์Šค ์ž…๋ ฅ INSERT INTO TB_BOARD VALUES(nextval('TB_BOARD_SEQ'), ....); #์‹œํ€€์Šค ์ดˆ๊ธฐํ™” ALTER SEQUENCE TB_USER_SEQ RESTART WITH 1;

PostgreSQL Sequence / postgreSQL ์‹œํ€€์Šค ์ƒ์„ฑ / ์ถ”๊ฐ€ / ์ดˆ๊ธฐํ™”
๐Ÿ’พDatabase/PostgreSQL 2020. 8. 30. 01:36

#์‹œํ€€์Šค ์ƒ์„ฑ create sequence TB_Board_SEQ start with 1 increment by 1 cache 10; #์‹œํ€€์Šค ์ถ”๊ฐ€ INSERT INTO TB_BOARD VALUES(nextval('TB_BOARD_SEQ'), ....); #์‹œํ€€์Šค ์ดˆ๊ธฐํ™” ALTER SEQUENCE TB_USER_SEQ RESTART WITH 1;

PostgreSQL ALTER ๋ช…๋ น์–ด
๐Ÿ’พDatabase/PostgreSQL 2020. 8. 30. 01:30

์ปฌ๋Ÿผ์ถ”๊ฐ€ ALTER TABLE board ADD create_date date; ์ปฌ๋Ÿผ์‚ญ์ œ ALTER TABLE board DROP create_date; ์ปฌ๋Ÿผ default๊ฐ’ ์ถ”๊ฐ€ ALTER TABLE board ALTER COLUMN name SET DEFAULT '์ด๋ฆ„์—†์Œ'; --๋ฌธ์ž ALTER TABLE board ALTER COLUMN no SET DEFAULT 1;--์ˆซ์ž ์ปฌ๋Ÿผ default๊ฐ’ ์ œ๊ฑฐ ALTER TABLE board ALTER name DROP DEFAULT; ์ปฌ๋Ÿผ NOT NULL ์ถ”๊ฐ€ ALTER TABLE board ALTER COLUMN name SET NOT NULL; ์ปฌ๋Ÿผ NOT NULL ์ œ๊ฑฐ ALTER TABLE board ALTER COLUMN name DROP NOT ..