jakob/Postico

Export using SQL insert

xarg opened this issue ยท 55 comments

xarg commented

Would be great to be able to export a table using SQL inserts. Right now only CSV seems to be available. Copy Special is great, but works only for the selected rows, not for whole tables.

Or if SQL inserts are hard to implement, perhaps just importing CSV would be nice.
How I do it now: COPY table FROM 'xxxx.csv' DELIMITER ',' CSV;

+1 preventing me from buying the full version

adi- commented

+1

+1

pg_dump -U username -d databasename > outputfile.sql

+1 @jakob you should consider using https://www.bountysource.com/ for crowd funding feature requests like these.

xarg commented

@astewart-twist: This is not an OS project so I don't think @jakob can use bountysource (maybe other similar platforms exist?) (https://github.com/bountysource/core/wiki/Frequently-Asked-Questions).

I hope I'm not going too off-topic but, I would say the best way to support the development is to buy the app or recommending it. Since I bought the app already I'm just gonna recommend it: https://twitter.com/humanfromearth/status/672559977446416385

I encourage you to do the same!

I also purchased the product and wanted to add that I also would like to see an SQL export feature. There are certain instances where I do not have access to pgdump and therefore the ability to do some from Postico would be great. I would pay extra to have had this feature had I known it was not native in the app. Love the product, just wish it was more complete.

jakob commented

I have a short question for everyone: would it be useful if I implemented a feature to just export the data as INSERT statements (like the copy special command), rather than creating a full SQL dump like pg_dump does? Exporting just the data would be much easier to implement than creating a full SQL dump.

xarg commented

For me INSERT statements are more than enough.

I concur.

Nicholas Colyer

On Dec 4, 2015, at 2:12 PM, Alex Plugaru notifications@github.com wrote:

For me INSERT statements are more than enough.

โ€”
Reply to this email directly or view it on GitHub.

I also agree INSERTs are enough. I mean definitely much better than nothing!

On Sat, Dec 5, 2015 at 2:16 AM, Nicholas Colyer notifications@github.com
wrote:

I concur.
Nicholas Colyer

On Dec 4, 2015, at 2:12 PM, Alex Plugaru notifications@github.com wrote:

For me INSERT statements are more than enough.

โ€”
Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub:
#36 (comment)

g3d commented

+1 for this feature.
I also purchased the product and wanted to add SQL export feature into it.

+1 for import / export of sql.

+1, really hope this feature can be implemented.

+1 for import / export of sql.

xarg commented

While having MacBook Pro Touchbar support #311 is cool, I'm really disappointed seeing it done while an issue like the current one or more importantly #82 have almost 2 years since are reported and nothing was done about it so far. @jakob can you give us an update on this? What's happening?

jakob commented

@xarg I'm sorry to hear you're not happy with the pace of development.

I try to prioritise features according to the impact they have versus the amount of effort required. Touch Bar is high impact & low effort, so it was a great first task for Chris, who is just getting started with Postico development.

Adding SQL export is a bit more effort, even though most of the parts are already there. Considering how many people support this issue, it was probably a mistake to delay this so long, and I should have started sooner. I'll see what I can do.

Currently I'm finalising the graphical index editor (#19) and trying to get the 1.1 update with lots of bug fixes out the door, but that release is blocked by an issue with Core Graphics on macOS 10.10 that I still need to work around. Meanwhile, Chris has started to work on CSV import (#68).

xarg commented

Thanks for your detailed reply @jakob. I appreciate it.

+1

+1

+1

+1 - very disappointed that this feature is not available. I bought Postico, thinking about using an alternative package. Other than that, great tool!

+1

+1

+1 It is more than 2 years already.

+1 just want sql inserts, nothing fancy.

+1

pyrat commented

+1

+1

bed42 commented

+1 :)

๐Ÿ‘

+1

pwm commented

+1

+1

Oh how nice would it be to be able to dump the entire database into a file!

+1 for sql inserts

+1

+1 :) That is the last thing preventing me from buying it :)

+1

jakob commented

Since we keep getting requests for this feature, I would like to ask for some feedback.

  1. Do you really want to just export INSERT statements to a file, or do you want full dumps (including CREATE TABLE statements etc)
  2. Can you explain how you would use this feature in a few sentences?
  3. Is using CSV Export / Import a possible alternative?

Background:
Most people who contact us via email with similar feature requests want a way to create full dumps (like pg_dump creates). These full dumps would contain both CREATE TABLE statements and INSERT statements. Implementing this feature would be a major undertaking and something that we just do not have the capacity for. Also, there's already pg_dump which does exactly what people want, so I don't see a strong argument for adding this feature to Postico. It would be convenient to have it built in, but it wouldn't really allow new workflows that currently aren't possible.

For us this feature currently doesn't have a high priority, but maybe we are missing some important scenarios how this feature would be useful, so please let us know how you would use this feature!

  1. Do you really want to just export INSERT statements to a file, or do you want full dumps (including CREATE TABLE statements etc)

Basically I'd want both:

  • CREATE TABLE + INSERTS (full copy)
  • only INSERTs (data dump) (--data-only)
  • only CREATE TABLEs (structure dump) (--schema-only)
  1. Can you explain how you would use this feature in a few sentences?

I would use it to:

  • copy and sync database schemas and data between databases
  • import SQL dumps i've received elsewhere
  • share SQL dumps with other people
  1. Is using CSV Export / Import a possible alternative?

Also a nice feature, but for me it wouldn't.