pgtap icon indicating copy to clipboard operation
pgtap copied to clipboard

Check if a constraint is validated or not

Open rodo opened this issue 8 years ago • 9 comments

Actually there is no function to check if a constraint is validate or not.

rodo avatar Nov 24 '16 09:11 rodo

I don't understand what you're asking for here. There are assertions for check constraints. But to make sure they actually do what they say, I tend to write tests that do the DML to exercise them.

theory avatar Nov 24 '16 22:11 theory

When create some constraint we set them as NOT VALID and after we validate them with ALTER TABLE ... VALIDATE CONSTRAINT So we need a test to check if the constraint was validate or not.

Hope to be more explicit :)

rodo avatar Nov 24 '16 22:11 rodo

Ah, yeah, that makes sense.

theory avatar Nov 24 '16 22:11 theory

I'll prepare a PR for this, have you already plan a date for the 0.97 ?

rodo avatar Nov 24 '16 22:11 rodo

Yeah, I meant to do it a few days ago. Will likely do it this weekend.

theory avatar Nov 24 '16 22:11 theory

Perfect, so I'll do my PR to be included in a 0.98 or later.

rodo avatar Nov 25 '16 09:11 rodo

Constraint validation is available since PG 9.1, @theory do we still need to support older version or not ?

rodo avatar Jan 17 '17 10:01 rodo

I think we were going to drop support for 8.x and keep 9.0, but maybe it was 9.1? @decibel?

theory avatar Jan 17 '17 17:01 theory

We need to dump any versions that don't support extensions, so anything older than 9.1.

decibel avatar Jan 17 '17 21:01 decibel