anse1 / sqlsmith

A random SQL query generator
GNU General Public License v3.0
754 stars 128 forks source link

Add an "exclude-catalog" option. #11

Closed rjuju closed 8 years ago

rjuju commented 8 years ago

Hello,

In https://www.postgresql.org/message-id/flat/CAAeH1nBQhjBhkVL9ya4YrEu5zj-AupiPAH2R02C0OUVuqwWVow@mail.gmail.com#CAAeH1nBQhjBhkVL9ya4YrEu5zj-AupiPAH2R02C0OUVuqwWVow@mail.gmail.com someone complained that sqlsmith wasn't using his own tables. The most likely reason is that there were much more catalog tables than user tables. To avoid this problem, I added the exclude-catalog option. It's been quite a long time since I wrote some C++, so I hope this patch is ok and the feature is wanted, otherwise feel free to reject this PR.

anse1 commented 8 years ago

Ack, if the database only contains few objects, Postgres' catalogs tend to make it unlikely that sqlsmith random picks them. I plan to implement the same include/exclude options pg_dump has, but didn't find the time to do that yet. I'll merge your patch after some testing.

Thanks!