Prepping to break every past release...

Started by Joshua D. Drakeabout 17 years ago48 messageshackers
Jump to latest
#1Joshua D. Drake
jd@commandprompt.com

Hello,

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

It seems to me that the best method would be to follow the
information_schema naming conventions as information_schema is standard
compliant (right?).

Thoughts?

Examples:

postgres=# \d pg_class
Table "pg_catalog.pg_class"
Column | Type | Modifiers
----------------+-----------+-----------
relname | name | not null
relnamespace | oid | not null
[...]

postgres=# \d pg_tables
View "pg_catalog.pg_tables"
Column | Type | Modifiers
-------------+---------+-----------
schemaname | name |
tablename | name |

postgres=# \d pg_stat_user_tables
View "pg_catalog.pg_stat_user_tables"
Column | Type | Modifiers
------------------+--------------------------+-----------
relid | oid |
schemaname | name |
relname | name |

postgres=# \d information_schema.tables
View "information_schema.tables"
Column | Type |
Modifiers
------------------------------+-----------------------------------+-----------
table_catalog | information_schema.sql_identifier |
table_schema | information_schema.sql_identifier |
table_name | information_schema.sql_identifier |

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Joshua D. Drake (#1)
Re: Prepping to break every past release...

Joshua D. Drake wrote:

Hello,

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

It seems to me that the best method would be to follow the
information_schema naming conventions as information_schema is standard
compliant (right?).

Thoughts?

What would be the benefit? Apart from satisfying a passion for consistency?

cheers

andrew

#3Dave Page
dpage@pgadmin.org
In reply to: Joshua D. Drake (#1)
Re: Prepping to break every past release...

On Wed, Mar 4, 2009 at 8:32 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

Hello,

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

I assume you'll be putting in the weeks/months of work required to fix
pgAdmin & phpPgAdmin which would be far better spent on new features
than uglifying the code in far nastier ways than the current state of
the catalogs?

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

#4Joshua D. Drake
jd@commandprompt.com
In reply to: Andrew Dunstan (#2)
Re: Prepping to break every past release...

On Wed, 2009-03-04 at 15:50 -0500, Andrew Dunstan wrote:

It seems to me that the best method would be to follow the
information_schema naming conventions as information_schema is standard
compliant (right?).

Thoughts?

What would be the benefit? Apart from satisfying a passion for consistency?

It would lower the cost (intellectually as well as dollars) of
development and administration for every single user of the database.

I can't count how many times I accidentally type tablename versus
table_name or worse relname, etc...

Sincerely,

Joshua D. Drake

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#5Joshua D. Drake
jd@commandprompt.com
In reply to: Dave Page (#3)
Re: Prepping to break every past release...

On Wed, 2009-03-04 at 21:01 +0000, Dave Page wrote:

On Wed, Mar 4, 2009 at 8:32 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

Hello,

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

I assume you'll be putting in the weeks/months of work required to fix
pgAdmin & phpPgAdmin which would be far better spent on new features
than uglifying the code in far nastier ways than the current state of
the catalogs?

*Shrug* long term consistency is the better choice.

Sincerely,

Joshua D. Drake

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#6Dave Page
dpage@pgadmin.org
In reply to: Joshua D. Drake (#5)
Re: Prepping to break every past release...

On Wed, Mar 4, 2009 at 9:09 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

I assume you'll be putting in the weeks/months of work required to fix
pgAdmin & phpPgAdmin which would be far better spent on new features
than uglifying the code in far nastier ways than the current state of
the catalogs?

*Shrug* long term consistency is the better choice.

Easy to say if you're not one of the people for whom such a change
would mean weeks of recoding, the need to start QA'ing everything from
scratch again and a hideous mess of code to cope with after adding
support for a new version with a different catalog schema.

Besides - what percentage of users ever go anywhere near the
catalogs? I'd guess a fraction of a percent of users, and maybe 1 - 5%
of developers.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

#7Joshua D. Drake
jd@commandprompt.com
In reply to: Dave Page (#6)
Re: Prepping to break every past release...

On Wed, 2009-03-04 at 21:14 +0000, Dave Page wrote:

On Wed, Mar 4, 2009 at 9:09 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

*Shrug* long term consistency is the better choice.

Easy to say if you're not one of the people for whom such a change
would mean weeks of recoding, the need to start QA'ing everything from
scratch again and a hideous mess of code to cope with after adding
support for a new version with a different catalog schema.

It is not easy to say. It is correct to say. I am under no illusion that
this will not be painful. As far as "man weeks of recoding". Sorry, I
know that will be tough.

Besides - what percentage of users ever go anywhere near the
catalogs? I'd guess a fraction of a percent of users, and maybe 1 - 5%
of developers.

Any DBA worth his salt uses system catalogs. Lowering the barrier on
uses these catalogs will lead to better and more useful tools as well.

Sincerely,

Joshua D. Drake

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#8Bill Moran
wmoran@potentialtech.com
In reply to: Dave Page (#6)
Re: Prepping to break every past release...

In response to Dave Page <dpage@pgadmin.org>:

On Wed, Mar 4, 2009 at 9:09 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

I assume you'll be putting in the weeks/months of work required to fix
pgAdmin & phpPgAdmin which would be far better spent on new features
than uglifying the code in far nastier ways than the current state of
the catalogs?

*Shrug* long term consistency is the better choice.

Easy to say if you're not one of the people for whom such a change
would mean weeks of recoding

Don't those folks have to tweak their code with each new release anyway?
Because those tables are constantly changing? I know we hit problems
with the way triggers are stored in 8.3 compared to earlier versions.

Granted, a sweeping change will necessitate a much larger tweak than
a few changed columns, but the long-term benefit should be cleaner
client code.

Besides - what percentage of users ever go anywhere near the
catalogs? I'd guess a fraction of a percent of users, and maybe 1 - 5%
of developers.

You could always take a survey ... bosses love surveys ...

I, for one, know of lots of code that I've written that accesses those
catalogs. I can't speak for other people.

--
Bill Moran
http://www.potentialtech.com
http://people.collaborativefusion.com/~wmoran/

#9Dave Page
dpage@pgadmin.org
In reply to: Joshua D. Drake (#7)
Re: Prepping to break every past release...

On Wed, Mar 4, 2009 at 9:23 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

It is not easy to say. It is correct to say. I am under no illusion that
this will not be painful. As far as "man weeks of recoding". Sorry, I
know that will be tough.

It'll be a complete and utter waste of time, and make a horrible mess
of any client code that has to support multiple versions.

Besides - what percentage of users ever go anywhere near the
catalogs? I'd guess a fraction of a percent of users, and maybe 1 - 5%
of developers.

Any DBA worth his salt uses system catalogs. Lowering the barrier on
uses these catalogs will lead to better and more useful tools as well.

Then psql and pgAdmin aren't doing their jobs properly. Tell us what you need.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

#10Tom Lane
tgl@sss.pgh.pa.us
In reply to: Joshua D. Drake (#1)
Re: Prepping to break every past release...

"Joshua D. Drake" <jd@commandprompt.com> writes:

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

It seems to me that the best method would be to follow the
information_schema naming conventions as information_schema is standard
compliant (right?).

This isn't happening. Don't waste our time suggesting it.

regards, tom lane

#11Dave Page
dpage@pgadmin.org
In reply to: Bill Moran (#8)
Re: Prepping to break every past release...

On Wed, Mar 4, 2009 at 9:24 PM, Bill Moran <wmoran@potentialtech.com> wrote:

In response to Dave Page <dpage@pgadmin.org>:

Don't those folks have to tweak their code with each new release anyway?
Because those tables are constantly changing?  I know we hit problems
with the way triggers are stored in 8.3 compared to earlier versions.

pg_trigger.tgenabled changed type in 8.3. That's an extremely rare
kind of change however - for example, triggers havent really changed
since at least 7.3 aside from that.

The sort of change JD seems to be suggesting /could/ involve rewriting
virtually every query in pgAdmin, as well as surrounding code.

Granted, a sweeping change will necessitate a much larger tweak than
a few changed columns, but the long-term benefit should be cleaner
client code.

Only if your app only targets one version of the server.

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

#12Joshua D. Drake
jd@commandprompt.com
In reply to: Dave Page (#9)
Re: Prepping to break every past release...

On Wed, 2009-03-04 at 21:27 +0000, Dave Page wrote:

On Wed, Mar 4, 2009 at 9:23 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

It is not easy to say. It is correct to say. I am under no illusion that
this will not be painful. As far as "man weeks of recoding". Sorry, I
know that will be tough.

It'll be a complete and utter waste of time, and make a horrible mess
of any client code that has to support multiple versions.

No actually it won't. It will make it easier for every product that uses
8.5 and above. Sometimes you have to cut the cord.

Any DBA worth his salt uses system catalogs. Lowering the barrier on
uses these catalogs will lead to better and more useful tools as well.

Then psql and pgAdmin aren't doing their jobs properly. Tell us what you need.

That is an interesting argument but honestly off topic for this thread
because that would be a series of new views and functions etc...

Sincerely,

Joshua D. Drake

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#13Joshua D. Drake
jd@commandprompt.com
In reply to: Tom Lane (#10)
Re: Prepping to break every past release...

On Wed, 2009-03-04 at 16:28 -0500, Tom Lane wrote:

"Joshua D. Drake" <jd@commandprompt.com> writes:

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

It seems to me that the best method would be to follow the
information_schema naming conventions as information_schema is standard
compliant (right?).

This isn't happening. Don't waste our time suggesting it.

I wasn't try to waste anyone's time. I thought doing things correctly
was a goal of this project. Sorry for the noise.

Sincerely,

Joshua D. Drake

regards, tom lane

--
PostgreSQL - XMPP: jdrake@jabber.postgresql.org
Consulting, Development, Support, Training
503-667-4564 - http://www.commandprompt.com/
The PostgreSQL Company, serving since 1997

#14Magnus Hagander
magnus@hagander.net
In reply to: Joshua D. Drake (#12)
Re: Prepping to break every past release...

Joshua D. Drake wrote:

On Wed, 2009-03-04 at 21:27 +0000, Dave Page wrote:

On Wed, Mar 4, 2009 at 9:23 PM, Joshua D. Drake <jd@commandprompt.com> wrote:

It is not easy to say. It is correct to say. I am under no illusion that
this will not be painful. As far as "man weeks of recoding". Sorry, I
know that will be tough.

It'll be a complete and utter waste of time, and make a horrible mess
of any client code that has to support multiple versions.

No actually it won't. It will make it easier for every product that uses
8.5 and above. Sometimes you have to cut the cord.

I think this sounds a lot like another request for a set of system views
with nicer names. That way, there'd be no break with backwards
compatibility, and you could use the easier names if you were on the
newer versions.

//Magnus

#15Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Joshua D. Drake (#4)
Re: Prepping to break every past release...

"Joshua D. Drake" <jd@commandprompt.com> wrote:

It would lower the cost (intellectually as well as dollars) of
development and administration for every single user of the
database.

-1

Any savings couldn't possibly pay for the cost and pain of this, at
least in our shop.

I can't count how many times I accidentally type tablename versus
table_name or worse relname, etc...

I can count the times I have done so on one finger. I don't find it
that hard to keep track of what column names are used in what table.

-Kevin

#16Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#14)
Re: Prepping to break every past release...

Magnus Hagander <magnus@hagander.net> writes:

I think this sounds a lot like another request for a set of system views
with nicer names.

What's the state of the newsysviews project, anyway? I don't recall
hearing much about it lately.

regards, tom lane

#17Josh Berkus
josh@agliodbs.com
In reply to: Joshua D. Drake (#1)
Re: Prepping to break every past release...

Joshua D. Drake wrote:

Hello,

Something that continues to grind my teeth about our software is that we
are horribly inconsistent with our system catalogs. Now I am fully and
100% aware that changing this will break things in user land but I want
to do it anyway. In order to do that I believe we need to come up with a
very loud, extremely verbose method of communicating to people that 8.5
*will* break things.

It seems to me that the best method would be to follow the
information_schema naming conventions as information_schema is standard
compliant (right?).

Well, honestly, this was one of the reasons why AndrewSN, David and I
pushed NewSysViews. Non-hackers really shouldn't be accessing the
system catalogs directly, and if information_schema doesn't give them
enough data, we should start adding new views to I_S.

--Josh

#18Josh Berkus
josh@agliodbs.com
In reply to: Tom Lane (#16)
Re: Prepping to break every past release...

Tom Lane wrote:

Magnus Hagander <magnus@hagander.net> writes:

I think this sounds a lot like another request for a set of system views
with nicer names.

What's the state of the newsysviews project, anyway? I don't recall
hearing much about it lately.

Final verdict was that we need to make it integrate better with
information_schema. At that point, our crew kinda ran out of energy and
it's been on hold ever since. But we've been talking about reviving it
again.

However, given the previous experience, I think we'd like some
reassurance that if NewSysviews was made conistent with
information_schema (and had good code, of course) that Hackers would be
interested in taking it. What nobody has any enthusiasm for is spending
a few dozen hours refactoring it, and then having to justify why we want
it *again*.

--Josh

#19Josh Berkus
josh@agliodbs.com
In reply to: Josh Berkus (#17)
Re: Prepping to break every past release...

Well, honestly, this was one of the reasons why AndrewSN, David and I

... and Elein ...

Show quoted text

pushed NewSysViews. Non-hackers really shouldn't be accessing the
system catalogs directly, and if information_schema doesn't give them
enough data, we should start adding new views to I_S.

#20Josh Berkus
josh@agliodbs.com
In reply to: Bill Moran (#8)
Re: Prepping to break every past release...

Bill,

You could always take a survey ... bosses love surveys ...

Done: http://wwwmaster.postgresql.org/community/

--Josh

#21Andrew Dunstan
andrew@dunslane.net
In reply to: Josh Berkus (#19)
#22Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Andrew Dunstan (#21)
#23Josh Berkus
josh@agliodbs.com
In reply to: Andrew Dunstan (#21)
#24Kevin Grittner
Kevin.Grittner@wicourts.gov
In reply to: Josh Berkus (#20)
#25Josh Berkus
josh@agliodbs.com
In reply to: Kevin Grittner (#24)
#26A.M.
agentm@themactionfaction.com
In reply to: Josh Berkus (#23)
#27Andrew Gierth
andrew@tao11.riddles.org.uk
In reply to: Tom Lane (#16)
#28Robert Haas
robertmhaas@gmail.com
In reply to: Joshua D. Drake (#1)
#29Greg Smith
gsmith@gregsmith.com
In reply to: Joshua D. Drake (#1)
#30Stephen Frost
sfrost@snowman.net
In reply to: Robert Haas (#28)
#31David Fetter
david@fetter.org
In reply to: Josh Berkus (#18)
#32Bruce Momjian
bruce@momjian.us
In reply to: Joshua D. Drake (#1)
#33Joshua D. Drake
jd@commandprompt.com
In reply to: Bruce Momjian (#32)
#34Simon Riggs
simon@2ndQuadrant.com
In reply to: Joshua D. Drake (#1)
#35Simon Riggs
simon@2ndQuadrant.com
In reply to: Andrew Gierth (#27)
#36Andrew Gierth
andrew@tao11.riddles.org.uk
In reply to: Simon Riggs (#35)
#37David Fetter
david@fetter.org
In reply to: Simon Riggs (#35)
#38Simon Riggs
simon@2ndQuadrant.com
In reply to: David Fetter (#37)
#39Joshua D. Drake
jd@commandprompt.com
In reply to: Simon Riggs (#38)
#40Andrew Gierth
andrew@tao11.riddles.org.uk
In reply to: Joshua D. Drake (#39)
#41Dave Page
dpage@pgadmin.org
In reply to: Andrew Gierth (#40)
#42Peter Eisentraut
peter_e@gmx.net
In reply to: Simon Riggs (#34)
#43Simon Riggs
simon@2ndQuadrant.com
In reply to: Peter Eisentraut (#42)
#44Joshua D. Drake
jd@commandprompt.com
In reply to: Simon Riggs (#43)
#45Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Josh Berkus (#23)
#46Josh Berkus
josh@agliodbs.com
In reply to: Jim Nasby (#45)
#47Josh Berkus
josh@agliodbs.com
In reply to: Josh Berkus (#19)
#48Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Josh Berkus (#46)