2 other pointers that might be useful to limit data during upload
- Where clause in a publication : Only simple intra table clauses, so not useful if you need to join with another table, but then you might want to use a trigger on the 'other' table to maintain a 'sync/don't sync' flag on the table that you need to upload & then use a publication.
- Discard the unwanted rows on upload_insert & upload_update. Yes, this will upload the data to the server before discarding it, but depending on the ratio between to upload & not to upload this might be simpler to maintain. (Perhaps use compression on the upload stream to compensate)
Not 100% sure they are valid solutions to your case , but they might be easier to maintain then the scripted upload.