pg_sample icon indicating copy to clipboard operation
pg_sample copied to clipboard

Add "flip" option to store most recent records

Open jmborr opened this issue 2 years ago • 5 comments

Example:
./pg_sample --ordered --flip <database_name>

./pg_sample --help
    --ordered
        Select from the table records after ordering the records by primary
        key value.

    --flip
        When passed as an option, the records will be ordered by decreasing
        primary key value. Will have an effect only if --ordered is also
        passed as an option.

jmborr avatar Jun 28 '22 17:06 jmborr

Thank you @jmborr! Will review and look at merge this weekend.

mla avatar Jun 29 '22 05:06 mla

@mla do you have a moment to review this?

jmborr avatar Jul 07 '22 11:07 jmborr

Sorry for delay @jmborr. Yes. I'm thinking we make your desc order the default. Seems likely that most ppl will want newest rather than oldest records anyway, and we had this issue come up recently elsewhere too.

mla avatar Jul 08 '22 16:07 mla

@jmborr please see the latest changes on dev branch. I changed --ordered to default to DESC and added --ordered-desc and --ordered-asc to control that if wanted.

mla avatar Jul 11 '22 22:07 mla

@mla Hi, sorry for not coming back earlier to this. I was on vacation and after that it was dealing with a big pile of work :sweat_smile: I've taken a look to the dev branch and I think I can close this PR since the functionality is now encoded in new options --ordered-desc and --ordered-asc, right?

jmborr avatar Aug 03 '22 18:08 jmborr

Sorry for not responding @jmborr! Yes, I believe what you need is handled by those new options. I'll get a new release pushed out this weekend. Thx.

mla avatar Aug 12 '22 03:08 mla