pgtap icon indicating copy to clipboard operation
pgtap copied to clipboard

create table_constraint_checksum function for pg_tapgen

Open marco44 opened this issue 6 years ago • 10 comments

Another request for comments, still linked with theory/tap-parser-sourcehandler-pgtap#18

This would make checking all constraints much simpler in pg_tapgen I think… pg_tapgen could generate all check for constraints in a database in one go, calling only this function systematically.

If you agree, please tell me how to proceed next… should there be all combinations of this function's parameters available ? (with and without schema, with and without description… there could be a great amount of possible combinations).

The thing I don't totally feel comfortable with this is if pg_get_constraintdef changes between releases. But consrc could change also anyway...

marco44 avatar Feb 04 '18 17:02 marco44

If you're thinking you might want to write a slew of these functions, you might want to consider making your own extension that depends on pgTAP and release it on PGXN.

theory avatar Feb 05 '18 15:02 theory

I just would like to add the minimum to be able to extend pg_tapgen to test more things. Shouldn't this be in pg_tab, then ?

marco44 avatar Feb 05 '18 15:02 marco44

Sure, that make sense. Do please add tests, however.

theory avatar Feb 05 '18 16:02 theory

Yes, I will, of course. And doc I presume. I just wanted to know if what I started made sense...

marco44 avatar Feb 05 '18 16:02 marco44

Looks okay to me, though I agree that it could get annoying if the output of pg_get_constraintdef changes between releases.

theory avatar Feb 05 '18 16:02 theory

Yes. It could be the same problem using consrc/confkey anyway… I don't see a smarter way out of this.

marco44 avatar Feb 05 '18 16:02 marco44

Agreed, but maybe check with pgsql-hackers.

theory avatar Feb 05 '18 16:02 theory

Just added the doc. No response from -hackers yet.

marco44 avatar Feb 06 '18 15:02 marco44

Still nothing on hackers :)

So I guess no one has a much better idea

marco44 avatar Feb 27 '18 16:02 marco44

Please merge current master as well; it has much improved automated testing.

nasbyj avatar Nov 14 '19 00:11 nasbyj