Обсуждение: SQL tab - DDL syntax
Hello,
I need to automate comparison of schemas between DBs.
I've found that pg_dump produces different order of tables etc.. so can't directly compare that
but on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)
Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?
Thank you,
Kind Regards
~Maciek
pgAdmin4 is open source so there is nothing to disclose :)
you can refer the source code https://www.pgadmin.org/development/git.php
--
Regards,
On Wed, Mar 29, 2017 at 6:21 PM, matshyeq <matshyeq@gmail.com> wrote:
Hello,I need to automate comparison of schemas between DBs.I've found that pg_dump produces different order of tables etc.. so can't directly compare thatbut on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?Thank you,Kind Regards~Maciek
when pressing 'Send' I felt this is the answer I'm going to get…
fair enough
Before I try to find the right place and figure it out - could you answer that question:
>> is the logic to get what's displayed in the SQL tab custom programmed in pgAdmin or leverages some some built-in postgres DB functionality and only presents same output back?
Thank you,
Kind Regards
~Maciek
On 30 March 2017 at 07:31, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote:
pgAdmin4 is open source so there is nothing to disclose :)you can refer the source code https://www.pgadmin.org/development/git.php --Regards,On Wed, Mar 29, 2017 at 6:21 PM, matshyeq <matshyeq@gmail.com> wrote:Hello,I need to automate comparison of schemas between DBs.I've found that pg_dump produces different order of tables etc.. so can't directly compare thatbut on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?Thank you,Kind Regards~Maciek
On Thu, Mar 30, 2017 at 1:05 PM, matshyeq <matshyeq@gmail.com> wrote:
when pressing 'Send' I felt this is the answer I'm going to get…fair enoughBefore I try to find the right place and figure it out - could you answer that question:
We reverse engineer the SQL based on the existing data in the datable.
Each node has its own logic for reverse engineering.
Output of the reversed engineering SQL can be combination of multiple Jinja2 templates.
For the database - we have logic in the 'web/pgadmin/browser/server_groups/servers/databases', we uses different Jinja2 templates.
Similarly - we have reverse engineering templates for each database objects.
You can find them under the database directories, and they maintain their hierarchical position in it.
Hope - this will help you to figure out, what you're looking for.
--
Thanks & Regards,
Ashesh Vashi
EnterpriseDB INDIA
>> is the logic to get what's displayed in the SQL tab custom programmed in pgAdmin or leverages some some built-in postgres DB functionality and only presents same output back?Thank you,Kind Regards~MaciekOn 30 March 2017 at 07:31, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: pgAdmin4 is open source so there is nothing to disclose :)you can refer the source code https://www.pgadmin.org/development/git.php --Regards,On Wed, Mar 29, 2017 at 6:21 PM, matshyeq <matshyeq@gmail.com> wrote:Hello,I need to automate comparison of schemas between DBs.I've found that pg_dump produces different order of tables etc.. so can't directly compare thatbut on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?Thank you,Kind Regards~Maciek
On Thu, Mar 30, 2017 at 1:17 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Thu, Mar 30, 2017 at 1:05 PM, matshyeq <matshyeq@gmail.com> wrote:when pressing 'Send' I felt this is the answer I'm going to get…fair enoughBefore I try to find the right place and figure it out - could you answer that question:
We reverse engineer the SQL based on the existing data representing the database object in the database server**.
Each node has its own logic for reverse engineering.Output of the reversed engineering SQL can be combination of multiple Jinja2 templates.For the database - we have logic in the 'web/pgadmin/browser/server_groups/servers/databases', we uses different Jinja2 templates. Similarly - we have reverse engineering templates for each database objects.You can find them under the database directories, and they maintain their hierarchical position in it.Hope - this will help you to figure out, what you're looking for.--Thanks & Regards,Ashesh VashiEnterpriseDB INDIA>> is the logic to get what's displayed in the SQL tab custom programmed in pgAdmin or leverages some some built-in postgres DB functionality and only presents same output back?Thank you,Kind Regards~MaciekOn 30 March 2017 at 07:31, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: pgAdmin4 is open source so there is nothing to disclose :)you can refer the source code https://www.pgadmin.org/development/git.php --Regards,On Wed, Mar 29, 2017 at 6:21 PM, matshyeq <matshyeq@gmail.com> wrote:Hello,I need to automate comparison of schemas between DBs.I've found that pg_dump produces different order of tables etc.. so can't directly compare thatbut on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?Thank you,Kind Regards~Maciek
That's great help, thank you Asesh!
You make distinction between nodes and database objects and there are separate templates for each set - could you clarify the difference between those (nodes/db objects) please?
Thank you,
Kind Regards
~Maciek
On 30 March 2017 at 09:48, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Thu, Mar 30, 2017 at 1:17 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote: On Thu, Mar 30, 2017 at 1:05 PM, matshyeq <matshyeq@gmail.com> wrote:when pressing 'Send' I felt this is the answer I'm going to get…fair enoughBefore I try to find the right place and figure it out - could you answer that question:We reverse engineer the SQL based on the existing data representing the database object in the database server**.Each node has its own logic for reverse engineering.Output of the reversed engineering SQL can be combination of multiple Jinja2 templates.For the database - we have logic in the 'web/pgadmin/browser/server_groups/servers/databases', we uses different Jinja2 templates. Similarly - we have reverse engineering templates for each database objects.You can find them under the database directories, and they maintain their hierarchical position in it.Hope - this will help you to figure out, what you're looking for.--Thanks & Regards,Ashesh VashiEnterpriseDB INDIA>> is the logic to get what's displayed in the SQL tab custom programmed in pgAdmin or leverages some some built-in postgres DB functionality and only presents same output back?Thank you,Kind Regards~MaciekOn 30 March 2017 at 07:31, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: pgAdmin4 is open source so there is nothing to disclose :)you can refer the source code https://www.pgadmin.org/development/git.php --Regards,On Wed, Mar 29, 2017 at 6:21 PM, matshyeq <matshyeq@gmail.com> wrote:Hello,I need to automate comparison of schemas between DBs.I've found that pg_dump produces different order of tables etc.. so can't directly compare thatbut on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?Thank you,Kind Regards~Maciek
On Thu, Mar 30, 2017 at 1:57 PM, matshyeq <matshyeq@gmail.com> wrote:
That's great help, thank you Asesh!You make distinction between nodes and database objects and there are separate templates for each set - could you clarify the difference between those (nodes/db objects) please?
I call anything that, is stored in the database server and has some identity, as database objects.
I refer database, schema, tables, indexes, roles, tablespace, etc. (and, many more) as a database object.
Nodes are the one, which are being shown on the left hand-side tree.
A database object is also a node, but - not all nodes are database objects.
e.g. Server Groups, Servers are nodes, but - not the database objects.
NOTE: I mean only me, not pgAdmin community here. :-)
--
Thanks & Regards,
Ashesh Vashi
EnterpriseDB INDIA
Thank you,Kind Regards~MaciekOn 30 March 2017 at 09:48, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote: On Thu, Mar 30, 2017 at 1:17 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote: On Thu, Mar 30, 2017 at 1:05 PM, matshyeq <matshyeq@gmail.com> wrote:when pressing 'Send' I felt this is the answer I'm going to get…fair enoughBefore I try to find the right place and figure it out - could you answer that question:We reverse engineer the SQL based on the existing data representing the database object in the database server**.Each node has its own logic for reverse engineering.Output of the reversed engineering SQL can be combination of multiple Jinja2 templates.For the database - we have logic in the 'web/pgadmin/browser/server_groups/servers/databases', we uses different Jinja2 templates. Similarly - we have reverse engineering templates for each database objects.You can find them under the database directories, and they maintain their hierarchical position in it.Hope - this will help you to figure out, what you're looking for.--Thanks & Regards,Ashesh VashiEnterpriseDB INDIA>> is the logic to get what's displayed in the SQL tab custom programmed in pgAdmin or leverages some some built-in postgres DB functionality and only presents same output back?Thank you,Kind Regards~MaciekOn 30 March 2017 at 07:31, Murtuza Zabuawala <murtuza.zabuawala@enterprisedb.com> wrote: pgAdmin4 is open source so there is nothing to disclose :)you can refer the source code https://www.pgadmin.org/development/git.php --Regards,On Wed, Mar 29, 2017 at 6:21 PM, matshyeq <matshyeq@gmail.com> wrote:Hello,I need to automate comparison of schemas between DBs.I've found that pg_dump produces different order of tables etc.. so can't directly compare thatbut on the other hand I see pgAdmin brings up really neat syntax (and different from pg_dump)Could you guys disclose if the logic to get SQL for a table is custom programmed by pgAdmin or uses some some built-in postgres DB functionality and only displays it's output back?Thank you,Kind Regards~Maciek