taler
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Taler] PostgreSQL reference to partitioned table


From: Thien-Thi Nguyen
Subject: [Taler] PostgreSQL reference to partitioned table
Date: Wed, 22 Dec 2021 04:43:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

I see this in the PostgreSQL error log:

 2021-12-22 04:08:11.537 EST [6460] ERROR:  cannot reference partitioned table 
"reserves"
 2021-12-22 04:08:11.537 EST [6460] STATEMENT:  CREATE TABLE IF NOT EXISTS 
reserves_in
          (reserve_in_serial_id BIGSERIAL UNIQUE
          ,reserve_pub BYTEA NOT NULL REFERENCES reserves (reserve_pub) ON 
DELETE CASCADE
          ,wire_reference INT8 NOT NULL
          ,credit_val INT8 NOT NULL
          ,credit_frac INT4 NOT NULL
          ,wire_source_serial_id INT8 NOT NULL REFERENCES wire_targets 
(wire_target_serial_id)
          ,exchange_account_section TEXT NOT NULL
          ,execution_date INT8 NOT NULL
          ,PRIMARY KEY (reserve_pub, wire_reference)
          );

This is w/ PostgreSQL 11, which IIUC does not support references
to partitioned tables:

 
https://stackoverflow.com/questions/58337835/postgresql-12-foreign-key-on-partitioning-tables-error

I believe PostgreSQL 12 (or at least, some later version of it)
does, so i'm writing to ask confirmation that the SQL code is
Good As Is, before updating the documentation to specify 12 as
the minimum supported PostgreSQL version.  (Perhaps there is
another way to express this that works w/ PostgreSQL 11?)

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)               ; (2021) Software Libero
   (pcase (context query)               ;       = Dissenso Etico
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]