Re: Getting source code for database objects

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Artacus <artacus(at)comcast(dot)net>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: Getting source code for database objects
Date: 2008-07-09 05:58:30
Message-ID: 48745386.7050507@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Artacus wrote:
> On pgadmin, when you click on a table or function, you get the source
> code (DDL) to create that table or function.
>
> I want to take that and check it into subversion so I have one file for
> each table, function, view, etc. My question is, how do you get that
> source code? I've been playing with pgadmin and wireshark trying to
> figure out what commands or queries it is using to no avail.

Easier would be just uing pg_dump -s >schema.sql to get all schema objects
so you could check them into subversion. If you want only specific
objects, pg_dump -l >listofobjects, then edit this list as you
like and use pg_dump -L listofobjects >someobjects.sql

This should get you going.

Cheers
Tino

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Artacus 2008-07-09 06:39:03 Re: array sort for varchar arrays?
Previous Message Pavel Stehule 2008-07-09 05:28:22 Re: array sort for varchar arrays?