documenting tables version control

Started by Suresh Rajaalmost 11 years ago12 messagesgeneral
Jump to latest
#1Suresh Raja
suresh.rajaabc@gmail.com

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

#2Steve Midgley
science@misuse.org
In reply to: Suresh Raja (#1)
Re: documenting tables version control

System catalogs should help, unless I misunderstand your question:

http://www.postgresql.org/docs/9.4/static/catalogs.html
http://www.postgresql.org/docs/9.4/static/view-pg-tables.html
http://stackoverflow.com/questions/20698169/how-to-use-postgres-pg-tables-to-compare-contraints

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

Show quoted text

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

#3Bill Moran
wmoran@potentialtech.com
In reply to: Suresh Raja (#1)
Re: documenting tables version control

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>

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

#4Joshua D. Drake
jd@commandprompt.com
In reply to: Suresh Raja (#1)
Re: [GENERAL] documenting tables version control

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-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql

#5Melvin Davidson
melvin6925@gmail.com
In reply to: Joshua D. Drake (#4)
Re: documenting tables version control

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.

#6Tim Clarke
tim.clarke@manifest.co.uk
In reply to: Suresh Raja (#1)
Re: documenting tables version control

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

Show quoted text

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

#7Gavin Flower
GavinFlower@archidevsys.co.nz
In reply to: Tim Clarke (#6)
Re: documenting tables version control

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

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

#8Tim Clarke
tim.clarke@manifest.co.uk
In reply to: Gavin Flower (#7)
Re: documenting tables version control

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

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

#9Suresh Raja
suresh.rajaabc@gmail.com
In reply to: Melvin Davidson (#5)
Re: documenting tables version control

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:

Show quoted text

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.

#10Steve Midgley
steve.midgley@mixrun.com
In reply to: Suresh Raja (#9)
Re: [GENERAL] documenting tables version control

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:

Show quoted text

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.

#11Steve Midgley
science@misuse.org
In reply to: Suresh Raja (#9)
Re: [GENERAL] documenting tables version control

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:

Show quoted text

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.

#12Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Suresh Raja (#9)
Re: [SQL] documenting tables version control

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

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