pgtap
pgtap copied to clipboard
col_is_pk variants
There should also be (name, name, name)
and (name, name, name[])
versions of col_is_pk
. Those versions already exist for col_is_unique()
.
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' );
?
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: