Skip to content

Table/Function dependency order #335

@pettijohn

Description

@pettijohn

pgschema 1.7.3 with file mode and plan database, PG 18, Ubuntu 24.04

Minimal repro here:

https://github.com/pettijohn/pgschema-bug

Run apply.sh and get Error: failed to apply desired state: failed to apply schema SQL to temporary schema pgschema_tmp_20260302_190352_4477b855: ERROR: relation "person_accounts" does not exist (SQLSTATE 42P01)

I'm using --file mode and explicitly create the tables followed by the function that depends on the tables. In schema.txt comment out the second include, the tables will apply correctly.

(Note, I am doing this in a dev container on a compose network, but I don't think that matters. I'm using the external plan database because the container runs as root and pgschema won't start the internal database as root.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions