Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
f903238
postgres_cdc: add multi-schema support
ness-david-dedu Jul 6, 2026
c38fd7a
postgres_cdc: reject empty quoted schema identifier and fix misleadin…
ness-david-dedu Jul 6, 2026
bda218d
postgres_cdc: add tests/current/ Docker Compose + Taskfile manual tes…
ness-david-dedu Jul 7, 2026
df2dca6
postgres_cdc: add commit_ts_ms and before metadata fields
ness-david-dedu Jul 7, 2026
e6bbd4c
Merge remote-tracking branch 'upstream/main' into feature/postgres_cd…
ness-david-dedu Jul 9, 2026
fcb0427
postgres_cdc: fix lint and docs
ness-david-dedu Jul 10, 2026
7bcc3ac
postgres_cdc: review fixes and test coverage
ness-david-dedu Jul 10, 2026
d39de9a
postgres_cdc: fix tests
ness-david-dedu Jul 13, 2026
5f9a2a8
Merge remote-tracking branch 'upstream/main' into feature/postgres_cd…
ness-david-dedu Jul 13, 2026
0aa387a
test(cdctest): waive tigerbeetle_cdc conformance fields
ness-david-dedu Jul 15, 2026
ba7c384
postgres_cdc: fix lint
ness-david-dedu Jul 15, 2026
bd3e383
Merge remote-tracking branch 'upstream/main' into feature/postgres_cd…
ness-david-dedu Jul 22, 2026
caa0b1a
postgres_cdc: skip missing tables per-schema instead of failing whole…
ness-david-dedu Jul 22, 2026
c161947
postgres_cdc: fix lint
ness-david-dedu Jul 22, 2026
0ed96fd
Update internal/impl/postgresql/pglogicalstream/schema_resolver.go
ness-david-dedu Jul 23, 2026
d893e1a
postgres_cdc: warn when schema pattern matches privilege-hidden schemas
ness-david-dedu Jul 27, 2026
28b2710
Merge branch 'main' into feature/postgres_cdc_multi_schema
josephwoodward Aug 4, 2026
0e662de
postgres_cdc: Address minor issues
josephwoodward Aug 4, 2026
e7dccc6
postgres_cdc: fix broken test
josephwoodward Aug 4, 2026
80e2204
postgres_cdc: replace pg_schema with database_schema
josephwoodward Aug 4, 2026
fc960ce
postgres_cdc: move schema validation to unit test closer to use
josephwoodward Aug 4, 2026
3411584
postgres_cdc: clean up redundant comment
josephwoodward Aug 4, 2026
bf28959
postgres_cdc: normalie test structure
josephwoodward Aug 4, 2026
58d3be8
postgres_cdc: t.Context()
josephwoodward Aug 4, 2026
6803eca
postgres_cdc: revert to existing behaviour
josephwoodward Aug 6, 2026
045cde2
postgres_cdc: improve on missing table coverage
josephwoodward Aug 6, 2026
c9e488b
update docs
josephwoodward Aug 6, 2026
0cd24bd
postgres_cdc: add schema_pattern field for multi-schema replication
ness-david-dedu Aug 10, 2026
33e4049
postgres_cdc: fix unicode schema_pattern rejection, sync changelog
ness-david-dedu Aug 11, 2026
b428bd7
postgres_cdc: fix stale schema_pattern refs in manual test harness
ness-david-dedu Aug 11, 2026
b46a4e5
postgres_cdc: add excluded_schema
ness-david-dedu Aug 11, 2026
dcda716
Merge remote-tracking branch 'upstream/main' into feature/postgres_cd…
ness-david-dedu Aug 11, 2026
7a136ba
postgres_cdc: fix failing signalling tests
josephwoodward Aug 12, 2026
52dbd2b
postgres_cdc: add further test coverage for uuid schemas
josephwoodward Aug 12, 2026
55cf17d
postgres_cdc: adress qupted schema
josephwoodward Aug 12, 2026
f39ff34
postgres_cdc: allow a leading digit for unquoted patterns
josephwoodward Aug 12, 2026
bbf65cd
postgres_cdc: remove now redundant subtests
josephwoodward Aug 12, 2026
715e233
postgres_cdc: ensure we don't discover views
josephwoodward Aug 12, 2026
65b08a9
postgres_cdc: require/assert switch
josephwoodward Aug 12, 2026
6079ef8
postgres_cdc: update docs
josephwoodward Aug 12, 2026
a74fdf7
postgres_cdc: group tables/schema var declarations
ness-david-dedu Aug 13, 2026
24aa2cd
postgres_cdc: auto-discover tables for schema_pattern when tables is …
ness-david-dedu Aug 13, 2026
96b8d78
postgres_cdc: rename schema_pattern/exclude_schemas to schema_include…
ness-david-dedu Aug 13, 2026
9897bbd
postgres_cdc: update docs
josephwoodward Aug 20, 2026
5a78e09
postgres_cdc: update tables docs
josephwoodward Aug 20, 2026
bc81de9
postgres_cdc: clean up testing and validation
josephwoodward Aug 20, 2026
ad32e8e
postgres_cdc: fix link
josephwoodward Aug 20, 2026
6c0ffcb
fix:
josephwoodward Aug 20, 2026
129878a
postgres_cdc: move schema resolution into dedicated file
josephwoodward Aug 21, 2026
ad1c132
clean up
josephwoodward Aug 21, 2026
591d750
postgres_cdc: improve schema discovery on reconnect loops
josephwoodward Aug 21, 2026
0a86a33
clean up logging
josephwoodward Aug 21, 2026
8f3c09f
move to package
josephwoodward Aug 21, 2026
c4a5a17
clean up
josephwoodward Aug 24, 2026
3063580
postgres_cdc: add docs to exported function
josephwoodward Aug 24, 2026
b70f5e3
exclude partition tables
josephwoodward Aug 24, 2026
8ff1382
clean up tests
josephwoodward Aug 24, 2026
292160a
remove ordering sensitivity
josephwoodward Aug 24, 2026
b6a6a73
postgres_cdc: improve filtering of tables
josephwoodward Aug 25, 2026
cf9e72b
clean up
josephwoodward Aug 25, 2026
3d8ce20
address test clean up
josephwoodward Aug 25, 2026
ad33bab
address filtering log
josephwoodward Aug 25, 2026
e252b5c
clean up
josephwoodward Aug 25, 2026
f9429f7
test coverage
josephwoodward Aug 25, 2026
7f30013
Fix logging issue
josephwoodward Aug 25, 2026
a03b4fd
update benchmark
josephwoodward Aug 25, 2026
dbf1a81
update sql script
josephwoodward Aug 25, 2026
2129b1b
docs
josephwoodward Aug 25, 2026
20d552d
clean up test
josephwoodward Aug 25, 2026
3451cec
address all tables
josephwoodward Aug 25, 2026
d39e081
for all tables
josephwoodward Aug 25, 2026
5ab78ee
docs
josephwoodward Aug 25, 2026
2739c37
reset bench files
josephwoodward Aug 25, 2026
7e38870
clean up schema vs schema_include config
josephwoodward Aug 25, 2026
95373a4
reset cl
josephwoodward Aug 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,48 @@ Changelog

All notable changes to this project will be documented in this file.

## 4.106.0 - 2026-08-20

### Added

- salesforce_cdc: Added decode-failure bounds and classification of schema-fetch errors (deterministic vs transient) to prevent infinite retry loops and livelocks, with terminal failures surfaced clearly to the health check. ([@squiidz](https://github.com/squiidz), [#4689](https://github.com/redpanda-data/connect/pull/4689))
- mongodb, mongodb_cdc: Added AWS IAM authentication (`MONGODB-AWS`) for MongoDB Atlas to the `mongodb` input, output, processor and cache, and to the `mongodb_cdc` input, via a new `aws` configuration block supporting the ambient credential chain, static keys, and assume-role chaining. ([@squiidz](https://github.com/squiidz), [#4690](https://github.com/redpanda-data/connect/pull/4690))
- mongodb_cdc: The input now checkpoints as soon as the initial snapshot completes and is fully acknowledged, so restarts resume the stream instead of re-running the snapshot; a stream position that can no longer be resumed from (for example one that has aged out of the oplog) is recovered by re-running the snapshot, bounded by a breaker that fails loudly instead of churning, with a new `on_unresumable_position` field controlling the lossy no-snapshot case (default `fail`) and a new `checkpoint_write_timeout` field bounding the detached checkpoint writes (the post-snapshot store and the recovery clear). ([@squiidz](https://github.com/squiidz), [#4690](https://github.com/redpanda-data/connect/pull/4690))

### Fixed

- aws_dynamodb_cdc: Fixed silent data loss in snapshot handling by gating checkpoint persistence on downstream acknowledgments, ensuring rejected batches are redelivered instead of skipped. ([@squiidz](https://github.com/squiidz), [#4687](https://github.com/redpanda-data/connect/pull/4687))
- aws_dynamodb_cdc: Fixed stream rotation and restart scenarios where start_from: latest was incorrectly applied to child shards and checkpoint-less shards discovered after initial setup, causing silent loss of backlog. ([@squiidz](https://github.com/squiidz), [#4687](https://github.com/redpanda-data/connect/pull/4687))
- cockroachdb_changefeed: Fixed unbounded silent data loss where transaction rows and backfill batches sharing timestamps could skip data on restart; now checkpoints only persist resolved timestamps to guarantee no loss. ([@squiidz](https://github.com/squiidz), [#4688](https://github.com/redpanda-data/connect/pull/4688))
- salesforce_cdc: Fixed multiple silent-loss paths in Pub/Sub gRPC handling and ack functions: full buffer now applies backpressure instead of dropping events, schema/decode failures reconnect without losing batches, and nacks now pin checkpoints. ([@squiidz](https://github.com/squiidz), [#4689](https://github.com/redpanda-data/connect/pull/4689))
- salesforce_cdc: Fixed off-by-one error in schema-retry budgeting and credential refresh in unanchored schema retries to prevent indefinite stalls under the default unlimited reconnect policy. ([@squiidz](https://github.com/squiidz), [#4689](https://github.com/redpanda-data/connect/pull/4689))

### Changed

- aws_dynamodb_cdc: Added auto_replay_nacks support to automatically retry transient downstream failures in-process, with nacks now advancing checkpoints when auto_replay_nacks is disabled. ([@squiidz](https://github.com/squiidz), [#4687](https://github.com/redpanda-data/connect/pull/4687))
- cockroachdb_changefeed: Changed nack handling to advance cursors when auto_replay_nacks is disabled, treating it as an opt-in to drop rejected messages per the framework contract. ([@squiidz](https://github.com/squiidz), [#4688](https://github.com/redpanda-data/connect/pull/4688))
- general: Updated CDC connector documentation across Microsoft SQL Server, MongoDB, and OracleDB with measured performance characteristics, scaling limitations, and configuration guidance based on real-world benchmarking. ([@prakhargarg105](https://github.com/prakhargarg105), [#4691](https://github.com/redpanda-data/connect/pull/4691))

## 4.105.0 - 2026-08-13

### Added

- postgres_cdc: Added support for control signals in PostgreSQL CDC by detecting and forwarding rows inserted into a configurable signal table downstream like regular messages. ([@josephwoodward](https://github.com/josephwoodward), [#4637](https://github.com/redpanda-data/connect/pull/4637))
- iceberg: Added an opt-in `merge_strategy: copy-on-write` for row-level `upsert`/`delete`, which materialises mutations by rewriting whole data files so the table only ever contains plain data files. This makes mutations readable by engine-backed catalogs that cannot handle merge-on-read equality deletes, such as the Databricks Unity Catalog and Snowflake. The default remains `merge-on-read`. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))
- iceberg: Added a `commit.cleanup_on_failure` field (default `true`) to disable connector-side cleanup of files written by failed commits, as an escape hatch for incident recovery. Disabling it can only leak orphan files, which regular orphan-file maintenance reclaims. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))

### Fixed

- iceberg: Fixed a regression introduced in 4.99.0 where a commit that landed server-side but was reported as failed (ambiguous 5xx, timeout, lost acknowledgement, or an unclassified error) had its just-written parquet files deleted by the failure-path cleanup, leaving the table unreadable. Failure cleanup is now gated on a provable catalog rejection, and commits detected as landed are reported as success, which also prevents the duplicate rows that redelivery produced. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))
- iceberg: Fixed no-timezone `timestamp` columns being written to parquet with `isAdjustedToUTC=true`, which is spec-incorrect and made them read back as `timestamptz`. New tables are written correctly; the encoding is pinned per table via a `redpanda-connect.timestamp-encoding` property so an existing table never changes or mixes encodings. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))
- iceberg: Fixed commits failing against catalogs that prohibit clients setting particular table properties (for example the Databricks Unity Catalog and `schema.name-mapping.default`) by learning the prohibited keys from the catalog's rejection and stripping them from subsequent commits. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))
- iceberg: Fixed several `identifier_fields` value shapes that silently matched no rows on `upsert`/`delete` — non-UTC `time` values, decimal floating-point ties, and `[]byte` values for string key columns — and fixed base64 mangling of binary and fixed column values during copy-on-write rewrites. All write paths now share a single value canonicaliser with the insert path. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))

### Change

- oracledb_cdc: Snapshot performance improvements by reusing seeded schema metadata [@josephwoodward](https://github.com/josephwoodward), [#4695](https://github.com/redpanda-data/connect/pull/4695))
- iceberg: Merge-key input strictness now matches the insert path: string-typed values for integer and boolean key columns (for example `{"id": "42"}` against a `BIGINT` key) previously matched by accident and are now rejected with an actionable error, and nanosecond-precision timestamp `identifier_fields` are now rejected under `merge-on-read` as they already were under copy-on-write. A table whose `write.delete.mode` property is explicitly `merge-on-read` also now rejects `copy-on-write` mutations rather than silently overriding the property. ([@Jeffail](https://github.com/Jeffail), [#4666](https://github.com/redpanda-data/connect/pull/4666))

## 4.104.0 - 2026-08-06

### Fixed
Expand Down
1 change: 1 addition & 0 deletions cmd/tools/integration/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
{"path":"./internal/impl/otlp"},
{"path":"./internal/impl/postgresql"},
{"path":"./internal/impl/postgresql/pglogicalstream"},
{"path":"./internal/impl/postgresql/pglogicalstream/multischema"},
{"path":"./internal/impl/pulsar","timeout":"10m"},
{"path":"./internal/impl/qdrant"},
{"path":"./internal/impl/questdb"},
Expand Down
83 changes: 75 additions & 8 deletions docs/modules/components/pages/inputs/postgres_cdc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ input:
include_transaction_markers: false
stream_snapshot: false
snapshot_batch_size: 1000
schema: public # No default (required)
tables: [] # No default (required)
schema: public
schema_include: ""
schema_exclude: []
tables: []
checkpoint_limit: 1024
temporary_slot: false
slot_name: my_test_slot # No default (required)
Expand Down Expand Up @@ -73,8 +75,10 @@ input:
include_transaction_markers: false
stream_snapshot: false
snapshot_batch_size: 1000
schema: public # No default (required)
tables: [] # No default (required)
schema: public
schema_include: ""
schema_exclude: []
tables: []
checkpoint_limit: 1024
temporary_slot: false
slot_name: my_test_slot # No default (required)
Expand Down Expand Up @@ -141,7 +145,7 @@ When set to true, empty messages with operation types BEGIN and COMMIT are gener

=== `stream_snapshot`

When set to true, the plugin will first stream a snapshot of all existing data in the database before streaming changes. In order to use this the tables that are being snapshot MUST have a primary key set so that reading from the table can be parallelized. Note that this has no effect if `tables` is left empty, since the snapshot is only planned for tables listed there.
When set to true, the plugin will first stream a snapshot of all existing data in the database before streaming changes. In order to use this the tables that are being snapshot MUST have a primary key set so that reading from the table can be parallelized. Note that this has no effect if `tables` is left empty and `schema_include` is NOT set, since in that case the snapshot is only planned for tables listed in `tables`. When `schema_include` IS set, leaving `tables` empty auto-discovers tables to snapshot instead - see `tables` below - and every discovered table must have a primary key.


*Type*: `bool`
Expand Down Expand Up @@ -171,11 +175,12 @@ snapshot_batch_size: 10000

=== `schema`

The PostgreSQL schema from which to replicate data.
The PostgreSQL schema from which to replicate data. Ignored when `schema_include` is used instead.


*Type*: `string`

*Default*: `"public"`

```yml
# Examples
Expand All @@ -185,15 +190,77 @@ schema: public
schema: '"MyCaseSensitiveSchemaNeedingQuotes"'
```

=== `schema_include`

The PostgreSQL schema pattern to replicate data from. Accepts an exact schema name or a glob pattern using `*` as a wildcard to match multiple schemas.

When a pattern is used, all schemas whose names match the pattern are replicated using a single replication slot and publication. This is useful for multi-tenant databases where each tenant has its own schema (e.g. `tenant_*` matches `tenant_foo`, `tenant_bar`, etc.).

Double-quoted identifiers are treated as exact names and do not support wildcards.

Schema pattern matching is re-evaluated every time the connector connects or reconnects - including the automatic reconnects that follow a transient replication failure - not just once at pipeline startup. This has two consequences that are easy to miss:

- A schema created after the pipeline started that matches the pattern is picked up on the next reconnect and its tables are added to the publication - a warning naming the schema is logged when this happens. However, because the replication slot already exists by then, those tables are treated as already caught up, so with `stream_snapshot` enabled the rows that existed in that schema before it was picked up are never snapshotted - only changes made after the schema is picked up are streamed, and the missed rows cannot be recovered short of resetting the replication slot.
- A schema that is dropped, renamed, or loses its `USAGE` grant between reconnects stops matching and its tables are removed from the publication on the next reconnect - a warning naming the schema is logged for all three cases, whether it dropped out via `USAGE` loss, a rename, or being dropped outright.

If this pattern matches no schema in the database, startup fails with an error - this holds whether or not `tables` is set. See `tables` below for what happens when it's left empty.

This pattern can contain characters that wouldn't be allowed in an unquoted schema name, because it's only ever compared against the real name of each schema in the database - it doesn't have to be a valid name itself. For example, a schema literally named `a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11` (which must have been created using double quotes, since hyphens aren't allowed in an unquoted `CREATE SCHEMA` statement) can still be matched using the unquoted pattern `a0eebc99-*`.

When set, this field takes over schema resolution entirely; `schema` is ignored (with a warning logged if it was explicitly set) rather than combined with it.


*Type*: `string`

*Default*: `""`

```yml
# Examples

schema_include: tenant_*

schema_include: '*'

schema_include: '"MyCaseSensitiveSchemaNeedingQuotes"'
```

=== `schema_exclude`

A list of schema names or glob patterns to exclude from the schemas matched by `schema_include`. Only valid when `schema_include` is set.

Each entry uses the same syntax as `schema_include`: an exact schema name, a glob pattern using `*` as a wildcard, or a double-quoted exact identifier for an exact, case-sensitive match.

A schema that matches `schema_include` and also matches any entry in this list is excluded from replication. An entry that does not match any schema resolved by `schema_include` is silently ignored, so a typo here simply excludes nothing rather than failing startup.

This exclusion is applied before `tables` is resolved, so it also takes effect when `tables` is left empty and tables are auto-discovered.


*Type*: `array`

*Default*: `[]`

```yml
# Examples

schema_exclude:
- tenant_internal
- tenant_test_*
```

=== `tables`

A list of table names to include in the logical replication. Each table should be specified as a separate item.

If left empty, the underlying PostgreSQL publication is created `FOR ALL TABLES`, which replicates every table in every schema of the database, ignoring `schema`. This also disables `stream_snapshot`, since the initial snapshot is only planned for tables listed here.
When `schema_include` is set, this list is resolved against each matched schema independently: a table missing from some (but not all) of the matched schemas is skipped for those schemas only (with a warning logged), tolerating multi-tenant setups where a table hasn't been provisioned in every schema yet. A table that's missing from every matched schema, however, is treated as a configuration error (most likely a typo) and startup fails, naming the missing table.

If left empty while `schema_include` is set, every base table in each matched (and un-excluded, see `schema_exclude`) schema is auto-discovered and published explicitly, instead of listing tables by hand - this is the expected way to replicate "every table" in a multi-tenant, schema-per-tenant setup without also picking up unrelated schemas. Startup fails if no matched schema contains any table. A partitioned table is auto-discovered as its individual leaf partitions rather than the table itself, so the `table` metadata on emitted messages will be the partition's name (e.g. `orders_2025`), not the parent's - list the parent explicitly in this field instead if you want it published as a single relation.

If left empty while `schema_include` is NOT set, the underlying PostgreSQL publication is instead created `FOR ALL TABLES`, which replicates every table in every schema of the database, ignoring `schema`. This also disables `stream_snapshot`, since the initial snapshot is only planned for tables listed here.


*Type*: `array`

*Default*: `[]`

```yml
# Examples
Expand Down Expand Up @@ -566,7 +633,7 @@ Optional external ID for the role assumption.

=== `signal_table_name`

The name of the table used to send control signals to the connector, excluding the schema. The table must
The name of the table used to send control signals to the connector, excluding the schema. Not supported when `schema_include` is set, since there is no single schema to anchor the signal table to. The table must
exist in the schema configured via the `schema` field, and must not also appear in `tables`
— the signal table is implicitly added to the publication and excluded from snapshot scans, so listing
it in both places is rejected at startup. It must have at least these columns — startup validation checks
Expand Down
2 changes: 1 addition & 1 deletion internal/impl/postgresql/bench/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ tasks:
psql:truncate:
desc: Truncate all benchmark tables
cmds:
- psql {{.PG_DSN}} -c "TRUNCATE public.users, public.products, public.cart;"
- psql {{.PG_DSN}} -c "TRUNCATE public.users, public.products, public.cart, tenant_a.users, tenant_b.users, tenant_c.users;"

psql:drop-slot:
desc: Drop the bench_slot replication slot so benchmarks can be re-run
Expand Down
3 changes: 3 additions & 0 deletions internal/impl/postgresql/bench/benchmark_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ input:
dsn: ${PG_DSN:postgres://postgres:postgres@localhost:5432/testdb?sslmode=disable}
stream_snapshot: true
schema: public
# schema_include: "*"
Comment thread
josephwoodward marked this conversation as resolved.
# schema_exclude:
# - tenant_c
tables:
- users
- products
Expand Down
56 changes: 51 additions & 5 deletions internal/impl/postgresql/bench/create.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
-- PostgreSQL Benchmark Setup Script
CREATE TABLE IF NOT EXISTS public.rpcn_signal_table (
id SERIAL PRIMARY KEY,
type VARCHAR(32),
data TEXT
);

CREATE TABLE IF NOT EXISTS public.users (
id SERIAL PRIMARY KEY,
Expand Down Expand Up @@ -42,3 +37,54 @@ CREATE TABLE IF NOT EXISTS public.cart (
info TEXT NOT NULL
);
ALTER TABLE public.cart REPLICA IDENTITY FULL;

-- schema 1
Comment thread
josephwoodward marked this conversation as resolved.
CREATE SCHEMA IF NOT EXISTS tenant_a;
CREATE TABLE IF NOT EXISTS tenant_a.users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
surname VARCHAR(100) NOT NULL,
about TEXT NOT NULL,
email VARCHAR(255) NOT NULL,
date_of_birth DATE,
join_date DATE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
is_active BOOLEAN NOT NULL DEFAULT TRUE,
login_count INT NOT NULL DEFAULT 0,
balance DECIMAL(10,2) NOT NULL DEFAULT 0.00
);
ALTER TABLE tenant_a.users REPLICA IDENTITY FULL;

-- schema 2
CREATE SCHEMA IF NOT EXISTS tenant_b;
CREATE TABLE IF NOT EXISTS tenant_b.users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
surname VARCHAR(100) NOT NULL,
about TEXT NOT NULL,
email VARCHAR(255) NOT NULL,
date_of_birth DATE,
join_date DATE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
is_active BOOLEAN NOT NULL DEFAULT TRUE,
login_count INT NOT NULL DEFAULT 0,
balance DECIMAL(10,2) NOT NULL DEFAULT 0.00
);
ALTER TABLE tenant_b.users REPLICA IDENTITY FULL;

-- schema 3
CREATE SCHEMA IF NOT EXISTS tenant_c;
CREATE TABLE IF NOT EXISTS tenant_c.users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
surname VARCHAR(100) NOT NULL,
about TEXT NOT NULL,
email VARCHAR(255) NOT NULL,
date_of_birth DATE,
join_date DATE,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
is_active BOOLEAN NOT NULL DEFAULT TRUE,
login_count INT NOT NULL DEFAULT 0,
balance DECIMAL(10,2) NOT NULL DEFAULT 0.00
);
ALTER TABLE tenant_c.users REPLICA IDENTITY FULL;
Loading