pgtap icon indicating copy to clipboard operation
pgtap copied to clipboard

col_is_pk variants

Open decibel opened this issue 8 years ago • 2 comments

There should also be (name, name, name) and (name, name, name[]) versions of col_is_pk. Those versions already exist for col_is_unique().

decibel avatar Dec 16 '16 21:12 decibel

I suspect col_is_pk( name, name, name) could clash with col_is_pk( name, name, text). How can you distinguish: col_is_pk( 'public', 'foo', 'id' ) from col_is_pk( 'foo', 'id', 'id is not pk' ); ?

fluca1978 avatar Oct 02 '18 14:10 fluca1978

There are a few other examples of functions with potentially-conflicting signatures. In those cases, we suggest that some of the params be cast to avoid the conflicts. See the docs for has_sequence for an example. They say:

If you find that the function call seems to be getting confused, cast the sequence to the NAME type:

theory avatar Oct 04 '18 02:10 theory