본문 바로가기
728x90
반응형

DB64

PostgreSQL 에서 hourly 파티션 생성및 삭제 함수 만들어진 파티션 조회 쿼리.SELECT inhrelid::regclass AS partition_nameFROM pg_inheritsWHERE inhparent = 'test_aaaaa'::regclass;================================================================================== 테스트 쿼리==================================================================================SELECT inhrelid::regclass AS partition_nameFROM pg_inheritsWHERE inhparent = 'test_aaaaa'::regclass;-- 파티.. 2025. 6. 10.
샘플데이터 test_aaaaa...파티션 테스트용 -- 샘플 파티션 테이블 생성 create table test_aaaaa ( col1 varchar(100) not null, col2 varchar(100) not null, col3 varchar(100) null, col4 int8 null, col5 int8 null, constraint test_aaaaa_pk primary key (col1) ) partition by range(col1); create table pt_test_aaaaa partition of test_aaaaa for values from ('20250609180000') to ('20250609190000'); select from test_aaaaa; 2025. 6. 9.
샘플데이터 user1 CREATE TABLE users (id SERIAL PRIMARY KEY,username VARCHAR(50) NOT NULL,email VARCHAR(100) NOT NULL,full_name VARCHAR(100),age INTEGER,city VARCHAR(50),created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP); CREATE INDEX idx_users_email ON users(email);CREATE INDEX idx_users_city ON users(city); INSERT INTO users (username, email, full_name, age, city) VALUES('john_doe', 'john.doe@email.com', 'John Doe.. 2025. 6. 9.
Postgres를 더 생산적이고 안전하게 사용하는 데 도움이 되는 실용적인 패턴들 https://news.hada.io/topic?id=20067 2025. 4. 2.
728x90
반응형