Thread: documenting tables version control

documenting tables version control

From
Suresh Raja
Date:
Hi All:

I have tables with different versions in the same schema.  Like 
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel sheet or may be in another schema in the database.  I would like to store information on table name, column names, column order, pry key column etc.  Also is there a way I can reverse engineer from the database itself.

Let me know if anybody any suggestion or format that they used.  I appreciate all your help and shall be suitably acknowledged. 

Thanks,
-Suresh Raja

Re: [SQL] documenting tables version control

From
Steve Midgley
Date:

On Tue, May 5, 2015 at 1:13 PM, Suresh Raja <suresh.rajaabc@gmail.com> wrote:
Hi All:

I have tables with different versions in the same schema.  Like 
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel sheet or may be in another schema in the database.  I would like to store information on table name, column names, column order, pry key column etc.  Also is there a way I can reverse engineer from the database itself.

Let me know if anybody any suggestion or format that they used.  I appreciate all your help and shall be suitably acknowledged. 

Thanks,
-Suresh Raja


Re: documenting tables version control

From
PT
Date:
On Tue, 5 May 2015 15:13:42 -0500
Suresh Raja <suresh.rajaabc@gmail.com> wrote:
>
>
> I have tables with different versions in the same schema.  Like
> T1a, T1b, T1c
> T2a, T2b, T2c, T2d
> ....
> ...
> etc.
>
>
> I'm interested in documenting various version of tables, may be in excel
> sheet or may be in another schema in the database.  I would like to store
> information on table name, column names, column order, pry key column etc.
> Also is there a way I can reverse engineer from the database itself.
>
> Let me know if anybody any suggestion or format that they used.  I
> appreciate all your help and shall be suitably acknowledged.

This section of the documentation should tell you everything you
need to know:
http://www.postgresql.org/docs/9.4/static/information-schema.html

--
PT <wmoran@potentialtech.com>


Re: documenting tables version control

From
"Joshua D. Drake"
Date:
On 05/05/2015 01:13 PM, Suresh Raja wrote:
>     Hi All:
>
>
> I have tables with different versions in the same schema.  Like
> T1a, T1b, T1c
> T2a, T2b, T2c, T2d
> ....
> ...
> etc.
>
>
> I'm interested in documenting various version of tables, may be in excel
> sheet or may be in another schema in the database.  I would like to
> store information on table name, column names, column order, pry key
> column etc.  Also is there a way I can reverse engineer from the
> database itself.
>
> Let me know if anybody any suggestion or format that they used.  I
> appreciate all your help and shall be suitably acknowledged.

Take a look at sqitch.

JD


>
> Thanks,
> -Suresh Raja
>


--
Command Prompt, Inc. - http://www.commandprompt.com/  503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing "I'm offended" is basically telling the world you can't
control your own emotions, so everyone else should do it for you.


Re: documenting tables version control

From
Melvin Davidson
Date:
Try this query and see if it fulfills your needs. Adjust the WHERE clause as needed.

SELECT
       table_catalog as database,
       table_schema as schema,
       table_name as table,
       column_name as column,
       ordinal_position as position,
       column_default as default,
       is_nullable,
       data_type as type,
       character_maximum_length as max_length
   FROM information_schema.columns
 WHERE table_name LIKE 'T%'
ORDER BY table_catalog,
         table_schema,
         table_name,
         ordinal_position;

On Tue, May 5, 2015 at 4:28 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

On 05/05/2015 01:13 PM, Suresh Raja wrote:
    Hi All:


I have tables with different versions in the same schema.  Like
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel
sheet or may be in another schema in the database.  I would like to
store information on table name, column names, column order, pry key
column etc.  Also is there a way I can reverse engineer from the
database itself.

Let me know if anybody any suggestion or format that they used.  I
appreciate all your help and shall be suitably acknowledged.

Take a look at sqitch.

JD



Thanks,
-Suresh Raja



--
Command Prompt, Inc. - http://www.commandprompt.com/  503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing "I'm offended" is basically telling the world you can't
control your own emotions, so everyone else should do it for you.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.

Re: documenting tables version control

From
Tim Clarke
Date:
We keep the DDL statements for any tables in our subversion code repository just like any other programming code. Takes only a moment then all history or changes is available and comparable. svnserve on our linux server, svn workbench on my ubuntu laptop, all open source :)

Tim Clarke
On 05/05/15 21:13, Suresh Raja wrote:
Hi All:

I have tables with different versions in the same schema.  Like 
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel sheet or may be in another schema in the database.  I would like to store information on table name, column names, column order, pry key column etc.  Also is there a way I can reverse engineer from the database itself.

Let me know if anybody any suggestion or format that they used.  I appreciate all your help and shall be suitably acknowledged. 

Thanks,
-Suresh Raja


Re: documenting tables version control

From
Gavin Flower
Date:
See comments at bottom,

On 06/05/15 20:47, Tim Clarke wrote:
> We keep the DDL statements for any tables in our subversion code
> repository just like any other programming code. Takes only a moment
> then all history or changes is available and comparable. svnserve on
> our linux server, svn workbench on my ubuntu laptop, all open source :)
>
> Tim Clarke
> On 05/05/15 21:13, Suresh Raja wrote:
>>
>>     Hi All:
>>
>>
>> I have tables with different versions in the same schema.  Like
>> T1a, T1b, T1c
>> T2a, T2b, T2c, T2d
>> ....
>> ...
>> etc.
>>
>>
>> I'm interested in documenting various version of tables, may be in
>> excel sheet or may be in another schema in the database.  I would
>> like to store information on table name, column names, column order,
>> pry key column etc.  Also is there a way I can reverse engineer from
>> the database itself.
>>
>> Let me know if anybody any suggestion or format that they used.  I
>> appreciate all your help and shall be suitably acknowledged.
>>
>> Thanks,
>> -Suresh Raja
>>
>
Please don't top post in these lists.

Not upgraded to git yet???  :-)


Cheers,
Gavin


Re: documenting tables version control

From
Tim Clarke
Date:
On 06/05/15 11:04, Gavin Flower wrote:
> See comments at bottom,
>
> On 06/05/15 20:47, Tim Clarke wrote:
>> We keep the DDL statements for any tables in our subversion code
>> repository just like any other programming code. Takes only a moment
>> then all history or changes is available and comparable. svnserve on
>> our linux server, svn workbench on my ubuntu laptop, all open source :)
>>
>> Tim Clarke
>>
> Please don't top post in these lists.
>
> Not upgraded to git yet???  :-)
>
>
> Cheers,
> Gavin

Too much real work to do ;)

Tim


Re: documenting tables version control

From
Suresh Raja
Date:
Thanks Melvin, Joshua, PT and Steve!

your information is good.  Im looking for creating a catalog for my application schema.  Do you have anything that you use for catalog of your schema.  Maybe using excel.

Thanks,
SR

On Tue, May 5, 2015 at 4:42 PM, Melvin Davidson <melvin6925@gmail.com> wrote:
Try this query and see if it fulfills your needs. Adjust the WHERE clause as needed.

SELECT
       table_catalog as database,
       table_schema as schema,
       table_name as table,
       column_name as column,
       ordinal_position as position,
       column_default as default,
       is_nullable,
       data_type as type,
       character_maximum_length as max_length
   FROM information_schema.columns
 WHERE table_name LIKE 'T%'
ORDER BY table_catalog,
         table_schema,
         table_name,
         ordinal_position;

On Tue, May 5, 2015 at 4:28 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

On 05/05/2015 01:13 PM, Suresh Raja wrote:
    Hi All:


I have tables with different versions in the same schema.  Like
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel
sheet or may be in another schema in the database.  I would like to
store information on table name, column names, column order, pry key
column etc.  Also is there a way I can reverse engineer from the
database itself.

Let me know if anybody any suggestion or format that they used.  I
appreciate all your help and shall be suitably acknowledged.

Take a look at sqitch.

JD



Thanks,
-Suresh Raja



--
Command Prompt, Inc. - http://www.commandprompt.com/  503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing "I'm offended" is basically telling the world you can't
control your own emotions, so everyone else should do it for you.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.


Re: [SQL] documenting tables version control

From
Steve Midgley
Date:

I just use sql tables. But if I represent them outside of pg I usually use migration files which are part of ruby on rails. But sqitch looks good too.

Steve

On May 6, 2015 7:31 AM, "Suresh Raja" <suresh.rajaabc@gmail.com> wrote:
Thanks Melvin, Joshua, PT and Steve!

your information is good.  Im looking for creating a catalog for my application schema.  Do you have anything that you use for catalog of your schema.  Maybe using excel.

Thanks,
SR

On Tue, May 5, 2015 at 4:42 PM, Melvin Davidson <melvin6925@gmail.com> wrote:
Try this query and see if it fulfills your needs. Adjust the WHERE clause as needed.

SELECT
       table_catalog as database,
       table_schema as schema,
       table_name as table,
       column_name as column,
       ordinal_position as position,
       column_default as default,
       is_nullable,
       data_type as type,
       character_maximum_length as max_length
   FROM information_schema.columns
 WHERE table_name LIKE 'T%'
ORDER BY table_catalog,
         table_schema,
         table_name,
         ordinal_position;

On Tue, May 5, 2015 at 4:28 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

On 05/05/2015 01:13 PM, Suresh Raja wrote:
    Hi All:


I have tables with different versions in the same schema.  Like
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel
sheet or may be in another schema in the database.  I would like to
store information on table name, column names, column order, pry key
column etc.  Also is there a way I can reverse engineer from the
database itself.

Let me know if anybody any suggestion or format that they used.  I
appreciate all your help and shall be suitably acknowledged.

Take a look at sqitch.

JD



Thanks,
-Suresh Raja



--
Command Prompt, Inc. - http://www.commandprompt.com/  503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing "I'm offended" is basically telling the world you can't
control your own emotions, so everyone else should do it for you.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.


Re: [SQL] documenting tables version control

From
Adrian Klaver
Date:
On 05/06/2015 07:31 AM, Suresh Raja wrote:
> Thanks Melvin, Joshua, PT and Steve!
>
> your information is good.  Im looking for creating a catalog for my
> application schema.  Do you have anything that you use for catalog of
> your schema.  Maybe using excel.

Yes Mercurial(mercurial.selenic.com) with Sqitch(sqitch.org). Then you
get a current catalog and a history of your catalog changes in Mercurial
and a way to go backwards and forwards in deploying those changes using
Sqitch.
>
> Thanks,
> SR


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: [SQL] documenting tables version control

From
Steve Midgley
Date:

I just use sql tables. But if I represent them outside of pg I usually use migration files which are part of ruby on rails. But sqitch looks good too.

Steve

On May 6, 2015 7:31 AM, "Suresh Raja" <suresh.rajaabc@gmail.com> wrote:
Thanks Melvin, Joshua, PT and Steve!

your information is good.  Im looking for creating a catalog for my application schema.  Do you have anything that you use for catalog of your schema.  Maybe using excel.

Thanks,
SR

On Tue, May 5, 2015 at 4:42 PM, Melvin Davidson <melvin6925@gmail.com> wrote:
Try this query and see if it fulfills your needs. Adjust the WHERE clause as needed.

SELECT
       table_catalog as database,
       table_schema as schema,
       table_name as table,
       column_name as column,
       ordinal_position as position,
       column_default as default,
       is_nullable,
       data_type as type,
       character_maximum_length as max_length
   FROM information_schema.columns
 WHERE table_name LIKE 'T%'
ORDER BY table_catalog,
         table_schema,
         table_name,
         ordinal_position;

On Tue, May 5, 2015 at 4:28 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

On 05/05/2015 01:13 PM, Suresh Raja wrote:
    Hi All:


I have tables with different versions in the same schema.  Like
T1a, T1b, T1c
T2a, T2b, T2c, T2d
....
...
etc.


I'm interested in documenting various version of tables, may be in excel
sheet or may be in another schema in the database.  I would like to
store information on table name, column names, column order, pry key
column etc.  Also is there a way I can reverse engineer from the
database itself.

Let me know if anybody any suggestion or format that they used.  I
appreciate all your help and shall be suitably acknowledged.

Take a look at sqitch.

JD



Thanks,
-Suresh Raja



--
Command Prompt, Inc. - http://www.commandprompt.com/  503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing "I'm offended" is basically telling the world you can't
control your own emotions, so everyone else should do it for you.


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.