Closed timbunce closed 8 years ago
This is a DBIC-generated message... @ribasushi - any suggestions?
@timbunce correctly deduced what happens, and it is squarely within RapidApp. Defining stuff as a primary key (or unique constraint) which then can return NULLs from the actual cursors can lead to a lot of problems, hence the warning.
@vanstyn Is there a reason you need the "fake PK" in the first place?
@ribasushi - we need a PK to be able to address the row (i.e. via a REST url)... for tables with no primary key at all, I have no choice but to consider the whole row, unless you have a better idea...
Also, regarding @timbunce 's suggestion "Perhaps the synthetic PK could be defined as all non-nullable columns?" -- what happens when two rows are identical except for values in nullable columns? This is a very plausible case imo...
As with everything else it depends how deep do you want to go.
$SIG{__WARN__}
trap and move on - some complex prefetches will fail, but it is not likely views will be involved in those. And writable views are pretty rare too.Pick your poison
When I run rdbic.pl on our main db (which no longer crashes, thanks!) I'm greeted with pages of output like this:
A total of 3687 instances of that kind of warning are generated!
I presume this is because there's no primary key defined on a view so a 'synthetic' PK is defined as being all the columns. Perhaps the synthetic PK could be defined as all non-nullable columns?