pg_sample icon indicating copy to clipboard operation
pg_sample copied to clipboard

Using --schema flag for having dump schema level granularity like in pg_dump and introduce --sample_schema overtaking old functionality

Open andilabs opened this issue 5 years ago • 3 comments

Hi @mla !

Thanks for the awesome job you have done by delivering that nice tool ;-)

I found it very useful. I have an idea for improvement (just have to grasp a bit of Perl):

  • let --schema param does behave the same as in pg_dump (best if not very complicated alow multiple repetitions of --schema or short -n to follow the pg_dump naming to specify multiple schemas to be considered by the script)
  • and --sample_schema takes responsibility for current --schema functionality of pg_sample.

tell me what do you think about, what limitations (both Perl and Postgres), edge cases should I consider when tackling that issue?

Another thing for improvement sharing probably a common codebase will be support for --table level granularity.

andilabs avatar Jan 24 '20 09:01 andilabs

very early version https://github.com/andilabs/pg_sample/pull/1/

andilabs avatar Jan 24 '20 12:01 andilabs

Hey, @andilabs! Great, thank you. Sorry for the delay in responding, I've been traveling. I'll take a look asap. Offhand, my only concern is backwards compatibility if we're changing the --schema option. It was dumb of me to have used --schema for that.

So if we change this and ppl use --schema with the old intention, then it should normally just fail with schema not found, I would hope. Maybe we issue a warning by default if the --schema option is used and there's no --quiet added or something.

mla avatar Jan 30 '20 12:01 mla

Hi @mla I made further improvements and created PR https://github.com/mla/pg_sample/pull/14

andilabs avatar Jan 31 '20 10:01 andilabs