|
I think using pg_dump in some cases is a good option , but not all the
time, having a function makes it much cleaner to use Consider pgAdmin lets say (and there are many such applications out there) , you need to show object DDL on the RHP and its nicely formatted and you can copy paste it and then perhaps export it in an SQL file. Now imagine you need to spawn a new process from inside the app for pg_dump, and then make it write to a file and then read the file to display the object DDL, which is possible but very messy looking code. Then there are issues with launching external processes on certain platforms (for example in Java if you start a new process from the runtime(), you need to make sure you properly flush out its stdout and stderr streams otherwise it can go in a deadlock etc), i would use a function, if available anyday Additionally there are such functions for other objects, but for tables you needed to construct it manually, so i also thought this would just complete the set and make it easier to write an SQL / DDL exporting app. Naz Gassiep wrote: Just a question, is there any advantage to having this then building a function in applications that wrap and use pg_dump with a few options? Surely that's a more appropriate way to achieve this functionality? - Naz.Usama Munir wrote: |
- Re: [HACKERS] pg_get_tabledef Usama Munir
- Re: [HACKERS] pg_get_tabledef Andrew Dunstan
- Re: [HACKERS] pg_get_tabledef Usama Munir
- Re: [HACKERS] pg_get_tabledef Andrew Dunstan
- Re: [HACKERS] pg_get_tabledef Usama Munir
- Re: [HACKERS] pg_get_tabledef Andrew Dunstan
- Re: [HACKERS] pg_get_tabledef Tom Lane
- Re: [HACKERS] pg_get_tabledef John DeSoi
