Benutzer-Werkzeuge

Webseiten-Werkzeuge


datenbank:postgresql_mit_partitionierten_tabellen

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
datenbank:postgresql_mit_partitionierten_tabellen [2026-06-22 14:00:46] manfreddatenbank:postgresql_mit_partitionierten_tabellen [2026-06-22 14:11:54] (aktuell) manfred
Zeile 156: Zeile 156:
  
 ===== partitionierte Tabelle mit Fremdschlüssel anlegen ===== ===== partitionierte Tabelle mit Fremdschlüssel anlegen =====
 +
 +Cluster-IP: ''192.168.1.1''
  
 <code sql komplettes Beispiel anlegen> <code sql komplettes Beispiel anlegen>
 -- ENUMs -- ENUMs
-CREATE TYPE net_enum AS ENUM ('D2','O2','D1_SP','D2_SP','E1_SP','DS_SP','DS','UNKNOWN');+CREATE TYPE net_enum AS ENUM ('A','B','C','D','E','F','G','UNKNOWN');
  
 CREATE TYPE js_enum AS ENUM ( CREATE TYPE js_enum AS ENUM (
Zeile 296: Zeile 298:
  
 <code bash Tabellen testen> <code bash Tabellen testen>
-> echo "\dt" | psql -U postgres -h192.168.1.192 -d testdatenbank+> echo "\dt" | psql -U postgres -h192.168.1.-d testdatenbank
                                  List of relations                                  List of relations
  Schema |            Name                   Type        |  Owner     Schema |            Name                   Type        |  Owner   
Zeile 323: Zeile 325:
 (21 rows) (21 rows)
  
-> echo "INSERT INTO log_tab (js, modus, z_options, job_options, execution_time) VALUES ('IN_PROGRESS','Statik','test','test','00:00:00');" | psql -U postgres -h192.168.1.192 -d testdatenbank+> echo "INSERT INTO log_tab (js, modus, z_options, job_options, execution_time) VALUES ('IN_PROGRESS','Statik','test','test','00:00:00');" | psql -U postgres -h192.168.1.-d testdatenbank
 INSERT 0 1 INSERT 0 1
-> echo "INSERT INTO origtab_log (e_id, net, zyk, origtab) VALUES (1, 'D2', '01', 'test');" | psql -U postgres -h192.168.1.192 -d testdatenbank+> echo "INSERT INTO origtab_log (e_id, net, zyk, origtab) VALUES (1, 'A', '01', 'test');" | psql -U postgres -h192.168.1.-d testdatenbank
 INSERT 0 1 INSERT 0 1
  
-> echo "SELECT * FROM log_tab;" | psql -U postgres -h192.168.1.192 -d testdatenbank+> echo "SELECT * FROM log_tab;" | psql -U postgres -h192.168.1.-d testdatenbank
  id |     js      |         start_time         | end_time | modus  | z_options | job_options | execution_time   id |     js      |         start_time         | end_time | modus  | z_options | job_options | execution_time 
-----+-------------+----------------------------+----------+----------+-----------+-------------+----------------+----+-------------+----------------------------+----------+--------+-----------+-------------+----------------
   1 | IN_PROGRESS | 2026-06-18 14:41:38.222129 |          | Statik | test      | test        | 00:00:00   1 | IN_PROGRESS | 2026-06-18 14:41:38.222129 |          | Statik | test      | test        | 00:00:00
 (1 row) (1 row)
  
-> echo "SELECT * FROM origtab_log;" | psql -U postgres -h192.168.1.192 -d testdatenbank+> echo "SELECT * FROM origtab_log;" | psql -U postgres -h192.168.1.-d testdatenbank
  id | e_id | net | zyk | origtab |      update_timestamp        id | e_id | net | zyk | origtab |      update_timestamp      
 ----+------+-----+-----+---------+---------------------------- ----+------+-----+-----+---------+----------------------------
-  1 |    1 | D2  | 01  | test    | 2026-06-18 14:41:38.225434+  1 |    1 | A   | 01  | test    | 2026-06-18 14:41:38.225434
 (1 row) (1 row)
 </code> </code>
  
 <code bash aktuelle Einstellungen anzeigen> <code bash aktuelle Einstellungen anzeigen>
-> echo "SELECT parent_table, control, partition_interval, retention, retention_keep_table, premake FROM public.part_config WHERE parent_table = 'public.origtab_log';" | psql -U postgres -h192.168.1.192 -d testdatenbank+> echo "SELECT parent_table, control, partition_interval, retention, retention_keep_table, premake FROM public.part_config WHERE parent_table = 'public.origtab_log';" | psql -U postgres -h192.168.1.-d testdatenbank
    parent_table         control      | partition_interval | retention | retention_keep_table | premake     parent_table         control      | partition_interval | retention | retention_keep_table | premake 
 --------------------+------------------+--------------------+-----------+----------------------+--------- --------------------+------------------+--------------------+-----------+----------------------+---------
/home/http/wiki/data/attic/datenbank/postgresql_mit_partitionierten_tabellen.1782136846.txt · Zuletzt geändert: von manfred