User Tools

Site Tools


postgresqlpartioning

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
postgresqlpartioning [2022/11/29 10:51] z0hpvkpostgresqlpartioning [2025/03/08 22:24] (current) – external edit 127.0.0.1
Line 42: Line 42:
  
 From Postgres 11 it is possible to create a default partition. \\ From Postgres 11 it is possible to create a default partition. \\
-<code> +<code SQL
-CREATE TABLE USERS_PART_2021 PARTITION OF USERS_PART DEFAULT; +CREATE TABLE USERS_PART_DF PARTITION OF USERS_PART DEFAULT; 
-<\code>+</code>
  
-===== Select =====+===== Select / Insert =====
  
-It is possible to show which partitioned table your select query has used. \\ +It is possible to show which partitioned table your select or insert query has used. \\ 
-<code>+<code SQL>
 SELECT tableoid, tableoid::regclass, * FROM users_part SELECT tableoid, tableoid::regclass, * FROM users_part
  WHERE user_role = 'A';  WHERE user_role = 'A';
-<\code>+</code> 
 + 
 +<code SQL> 
 +INSERT INTO users_part (username, user_role)  
 +VALUES ('bloggs01', 'A')  
 +RETURNING tableoid::regclass, user_id; 
 +</code> 
 + 
 +===== Example ===== 
 +[[PGPartitionExample| Partitioning Example]]\\ 
  
  
  
postgresqlpartioning.1669719075.txt.gz · Last modified: 2025/03/08 22:23 (external edit)