20 Kasım 2022 Pazar

EVERY - Aggregate Metodu

Örnek
Şöyle yaparız
SELECT author_id, EVERY( title LIKE '%a')
FROM book
GROUP BY author_id


author_id every
--- ---
1 false
2 true


Analytic Functions / Window Functions - ROWS BETWEEN

Örnek
Soru şöyle
For example, if we want to sum up the revenue from all previous years till this year, we can use this window function!
Şöyle yaparız
SELECT year, SUM (revenue) 
OVER ( 
  ROWS BETWEEN 
    UNBOUNDED PRECEEDING 
    AND 
    CURRENT ROW
) AS running_sum
FROM revenue_table

8 Kasım 2022 Salı

Debezium Kullanımı İçin Hazırlık

1. User ve Role Yaratılır
Şöyle yaparız
CREATE USER cdcuser WITH PASSWORD 'cdcpassword' REPLICATION LOGIN;

CREATE ROLE replication_group WITH USER foouser, cdcuser;
GRANT CREATE ON DATABASE quant_core TO replication_group;
GRANT USAGE ON SCHEMA foo TO replication_group;
GRANT CREATE ON SCHEMA foo TO replication_group;

CREATE TABLE foo.cdc_heartbeat (
    heartbeat bit
);
ALTER TABLE foo.cdc_heartbeat OWNER TO cdcuser;
2. WAL Seviyesi
var/lib/postgresql/data/postgresql.conf dosyasındaki wal_level alanını değeri logical yapılır