Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2014-04-13 Thread Moshe Jacobson
On Sat, Apr 12, 2014 at 2:57 AM, Tony Theodore wrote: > > I know this is a terribly old thread, but if you are still looking for >> software to provide an audit trail of changes in the database, please see >> Cyan Audit at http://pgxn.org/dist/cyanaudit. I think it will do just >> what you're loo

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2014-04-11 Thread Tony Theodore
On 12 April 2014 07:02, Moshe Jacobson wrote: > > I know this is a terribly old thread, but if you are still looking for > software to provide an audit trail of changes in the database, please see > Cyan Audit at http://pgxn.org/dist/cyanaudit. I think it will do just what > you're looking for.

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2014-04-11 Thread Moshe Jacobson
I know this is a terribly old thread, but if you are still looking for software to provide an audit trail of changes in the database, please see Cyan Audit at http://pgxn.org/dist/cyanaudit. I think it will do just what you're looking for. (Full disclosure: I am the author of this software) Moshe

Re: [GENERAL] database design best pratice help

2013-01-30 Thread Wolfgang Keller
> In my db I have about one hundred tables like this: > > code > description > > To avoid to have a so great number of similar tables in the db > I wonder if it is a good idea to unify all these tables in one big > table like this: > > id > code > table_ name > description Bad idea. E.g. how d

Re: [GENERAL] database design best pratice help

2013-01-28 Thread Bob Futrelle
Yes. The general rules are: Many normalized tables. OK. Denormalizing simply to reduce the number of tables. Not OK. - Bob On Mon, Jan 28, 2013 at 1:47 PM, Kevin Grittner wrote: > Jose Soares wrote: > > > In my db I have about one hundred tables like this: > > > > code > > description >

Re: [GENERAL] database design best pratice help

2013-01-28 Thread Kevin Grittner
Jose Soares wrote: > In my db I have about one hundred tables like this: > > code > description > > To avoid to have a so great number of similar tables in the db > I wonder if it is a good idea to unify all these tables in one > big table like this: > > id > code > table_ name > description > C

Re: [GENERAL] database design best pratice help

2013-01-28 Thread Albe Laurenz
Jose Soares wrote: > I have a question about database design best pratice. > > In my db I have about one hundred tables like this: > > code > description > > To avoid to have a so great number of similar tables in the db > I wonder if it is a good idea to unify all these tables in one big table

Re: [GENERAL] database design best pratice help

2013-01-28 Thread Thomas Kellerer
I'll answer with the same things I did on the Oracle list :) code description To avoid to have a so great number of similar tables in the db I wonder if it is a good idea to unify all these tables in one big table like this: id code table_ name description The advantages are: 1. only one tab

[GENERAL] database design best pratice help

2013-01-28 Thread Jose Soares
Hi all, I have a question about database design best pratice. In my db I have about one hundred tables like this: code description To avoid to have a so great number of similar tables in the db I wonder if it is a good idea to unify all these tables in one big table like this: id code table_

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-08 Thread Wolfgang Keller
>For several reasons (including operational and legal) once data are > entered in a table they cannot be changed or deleted without an audit > trail of the change, when it occurred, who made the change, and the > reason for it. Besides the need for storing additional information that the user

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-08 Thread Stevo Slavić
In Java world, for this purpose I tend to use JPA/Hibernate with Envers http://www.jboss.org/envers - db vendor agnostic solution. Kind regards, Stevo Slavic. On Tue, Jan 8, 2013 at 6:32 AM, Craig Ringer wrote: > On 4/01/2013 12:09 AM, Adrian Klaver wrote: > > On 01/03/2013 07:38 AM, Rich Shep

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-07 Thread Craig Ringer
On 4/01/2013 12:09 AM, Adrian Klaver wrote: > On 01/03/2013 07:38 AM, Rich Shepard wrote: > >> >>The middleware of the application needs to check this table when data >> are >> to be viewed in the UI and present only the current row contents. A >> separate >> view would display a history of cha

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Bèrto ëd Sèra
Hi again, > I understand it and for this reason I said to "use some strategy to purge > old historical data *OR* make your audit tables partitioned"... yes, prepare to scale up in any case, even if it seems to be a remote chance ATM. If the "untouched" nature of this data is so critical, you have

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Fabrízio de Royes Mello
On Thu, Jan 3, 2013 at 2:50 PM, Rich Shepard wrote: > > There should not be many changes in these tables. Ok. > > And historical data > cannot be purged or the purpose of maintaining a history is lost. The > history is valuable for tracking changes over time in regulatory agency > staff and to

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
On Thu, 3 Jan 2013, Bèrto ëd Sèra wrote: if it's a strict legal requirement you may want to enforce it with a trigger system, so that each time a record is inserted/updated/deleted you create an exact copy of it in a historical table, that has the original record plus data about who performed th

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Bèrto ëd Sèra
Hi Rich, if it's a strict legal requirement you may want to enforce it with a trigger system, so that each time a record is inserted/updated/deleted you create an exact copy of it in a historical table, that has the original record plus data about who performed the operation, when, from which IP,

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
On Thu, 3 Jan 2013, Adrian Klaver wrote: As a matter of course I include fields to record the timestamp and user for insert of records and last update of record on my tables. Adrian, This is a useful addition to the application. For a relatively simple solution see this blog post I put up

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
On Thu, 3 Jan 2013, Fabrízio de Royes Mello wrote: And keep in mind that kind of table tend to grow quickly, so you must use some strategy to purge old historical data or make your audit table partitioned... Fabrizio, There should not be many changes in these tables. And historical data can

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Fabrízio de Royes Mello
On Thu, Jan 3, 2013 at 2:09 PM, Adrian Klaver wrote: > > On 01/03/2013 07:38 AM, Rich Shepard wrote: > >>The middleware of the application needs to check this table when data >> are >> to be viewed in the UI and present only the current row contents. A >> separate >> view would display a histo

Re: [GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Adrian Klaver
On 01/03/2013 07:38 AM, Rich Shepard wrote: The middleware of the application needs to check this table when data are to be viewed in the UI and present only the current row contents. A separate view would display a history of changes for that row. All thoughts, suggestions, and recommen

[GENERAL] Database Design: Maintain Audit Trail of Changes

2013-01-03 Thread Rich Shepard
I have the need to develop an application that will use postgres as the back end, and most of the design has been worked out, but I've one issue left to resolve and want help in this. If this is not the appropriate forum for this type of question, please point me in the right direction. For s

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread Andy Colson
On 03/20/2011 09:25 PM, ray joseph wrote: From: Andy Colson [mailto:a...@squeakycode.net] Sent: Sunday, March 20, 2011 8:48 PM Subject: Re: [GENERAL] Database Design for Components and Interconnections You may, or may not, want a top level table: create table chips ( chipid serial

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread ray joseph
> From: Andy Colson [mailto:a...@squeakycode.net] > Sent: Sunday, March 20, 2011 8:48 PM > Subject: Re: [GENERAL] Database Design for Components and Interconnections > > >> > >> You may, or may not, want a top level table: > >> > >> create table c

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread Andy Colson
You may, or may not, want a top level table: create table chips ( chipid serial, descr text ); Yes, I see great value in a top level component table. I am not sure how to handle multiple instances of the same type of chip in different services. I think the idea is to give eac

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread ray joseph
> From: Andy Colson [mailto:a...@squeakycode.net] > Sent: Sunday, March 20, 2011 9:01 AM > > On 03/19/2011 11:40 PM, ray wrote: > > I am looking for some help in database design. I would like to design > > a database to help design alternative designs of a basic electronic > > circuit design.

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread ray joseph
nt on designing for efficient representation rather than use cases. I am guessing that means normalization? ray -Original Message- From: David Johnston [mailto:pol...@yahoo.com] Sent: Sunday, March 20, 2011 9:05 AM To: 'ray'; pgsql-general@postgresql.org Subject: RE: [GENERAL] Data

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread David Johnston
ssage- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of ray Sent: Sunday, March 20, 2011 12:40 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Database Design for Components and Interconnections I am looking for some help in database design. I

Re: [GENERAL] Database Design for Components and Interconnections

2011-03-20 Thread Andy Colson
On 03/19/2011 11:40 PM, ray wrote: I am looking for some help in database design. I would like to design a database to help design alternative designs of a basic electronic circuit design. I have a list of components that will be interconnected for a basic design. Additional components and ass

[GENERAL] Database Design for Components and Interconnections

2011-03-19 Thread ray
I am looking for some help in database design. I would like to design a database to help design alternative designs of a basic electronic circuit design. I have a list of components that will be interconnected for a basic design. Additional components and associated connections are identified fo

Re: [GENERAL] database design

2011-02-15 Thread David Johnston
@postgresql.org] On Behalf Of Kalai R Sent: Tuesday, February 15, 2011 1:46 AM To: pgsql-general@postgresql.org Subject: [GENERAL] database design hi, We are going to design database for a large company, which has many branches. In each branch they maintain data separately and also they mai

Re: [GENERAL] database design

2011-02-14 Thread Sim Zacks
Hi Kalai, From the vagueness of your question, it sounds like you need a DBA to design the database. But basically you need to put the branch id as a foreign key in all data tables and then you can generate reports grouped by date or portion thereof, branch or company. Sim On 02/15/201

Re: [GENERAL] database design

2011-02-14 Thread John R Pierce
On 02/14/11 10:45 PM, Kalai R wrote: hi, We are going to design database for a large company, which has many branches. In each branch they maintain data separately and also they maintain year wise data. ie Company | Branch | Yearly Also we need to compare and prepare reports by

[GENERAL] database design

2011-02-14 Thread Kalai R
hi, We are going to design database for a large company, which has many branches. In each branch they maintain data separately and also they maintain year wise data. ie Company | Branch | Yearly Also we need to compare and prepare reports by combine all branched data. How should we

[GENERAL] Database Design - Which design should I use? Two options.

2011-02-05 Thread Andre Lopes
Hi, I'm designing a database, but I'm with some doubts in the design. I have posted a question in stackoverflow because of the use of images. Can someone give some clues about which design should I use? The link to the question is here: http://stackoverflow.com/questions/4909105/database-design-

Re: [GENERAL] Database Design Question

2011-02-03 Thread Carlos Mennens
Thanks for all the suggestions and everyone appears to agree that if the applications don't need to share data, then I should split them up into separate database and nothing more. I appreciate your input and explanations as well. -Carlos -- Sent via pgsql-general mailing list (pgsql-general@po

Re: [GENERAL] Database Design Question

2011-02-03 Thread Sim Zacks
Just trying to understand good DBA design practice. This is obviously a very general question but any feedback on what good or bad issues would come from me dumping all my tables for applications in one database or spread out across multiple databases on PostgreSQL. Thank you! As a general rule

Re: [GENERAL] Database Design Question

2011-02-02 Thread Martijn van Oosterhout
On Wed, Feb 02, 2011 at 11:44:51AM -0800, John R Pierce wrote: > On 02/02/11 11:24 AM, Joshua D. Drake wrote: >> Forget separate databases. Use separate users with schemas. > > for canned applications like mediawiki and phpbb? not sure they > support that. > If they use different users you can

Re: [GENERAL] Database Design Question

2011-02-02 Thread Chris Browne
carlos.menn...@gmail.com (Carlos Mennens) writes: > I was sitting down thinking the other day about when is it good to > generate a new database or just use an existing one. For example, lets > say my company name is called 'databasedummy.org' and I have a > database called 'dbdummy'. Now I need Po

Re: [GENERAL] Database Design Question

2011-02-02 Thread Gary Chambers
Forget separate databases. Use separate users with schemas. for canned applications like mediawiki and phpbb? not sure they support that. Mediawiki does -- I'm doing just that. It's been liberating learning how PostgreSQL deals with schemas (and applying that knowledge). -- Gary Chambers -

Re: [GENERAL] Database Design Question

2011-02-02 Thread John R Pierce
On 02/02/11 11:24 AM, Joshua D. Drake wrote: Forget separate databases. Use separate users with schemas. for canned applications like mediawiki and phpbb? not sure they support that. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscript

Re: [GENERAL] Database Design Question

2011-02-02 Thread Joshua D. Drake
On Wed, 2011-02-02 at 11:08 -0800, John R Pierce wrote: > On 02/02/11 10:32 AM, Carlos Mennens wrote: > I would create a seperate database for each thing that has nothing to do > with the other things.I doubt mediawiki and phpbb will ever share > any data, they are totally different applicat

Re: [GENERAL] Database Design Question

2011-02-02 Thread David Johnston
ailto:pgsql-general-ow...@postgresql.org] On Behalf Of John R Pierce Sent: Wednesday, February 02, 2011 2:09 PM To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Database Design Question On 02/02/11 10:32 AM, Carlos Mennens wrote: > I was sitting down thinking the other day about when is it

Re: [GENERAL] Database Design Question

2011-02-02 Thread John R Pierce
On 02/02/11 10:32 AM, Carlos Mennens wrote: I was sitting down thinking the other day about when is it good to generate a new database or just use an existing one. For example, lets say my company name is called 'databasedummy.org' and I have a database called 'dbdummy'. Now I need PostgreSQL to

[GENERAL] Database Design Question

2011-02-02 Thread Carlos Mennens
I was sitting down thinking the other day about when is it good to generate a new database or just use an existing one. For example, lets say my company name is called 'databasedummy.org' and I have a database called 'dbdummy'. Now I need PostgreSQL to manage several applications for my company: -

Re: [GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-09 Thread Alban Hertroys
On 9 May 2010, at 6:49, Rick Yorgason wrote: > So, your first suggestion would look like this: > >> reginfo(order_id, product_id, reginfo1_columns, reginfo2_columns, FOREIGN >> KEY(order_id, product_id) REFERENCES order_items) > > For the sake of illustration, let's say that order_item's foreig

Re: [GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-08 Thread Rick Yorgason
On 08/05/2010 10:33 PM, Tom Lane wrote: Since you say that --disable-triggers doesn't help, I guess that you're applying that function not in a trigger but in a CHECK constraint? That's pretty horrid in itself: CHECK is *not* meant to enforce anything except local properties of the newly inserted

Re: [GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-08 Thread Tom Lane
Rick Yorgason writes: > In other words, (order_id, product_id) of order_item is a foreign key to > either reginfo1, reginfo2, or nothing, depending on which product it is. I think you'll find that few people regard that as good database design. > The works really well, until I try to use pg_dum

[GENERAL] Database design confusing pg_restore, and misc pg_restore issues

2010-05-08 Thread Rick Yorgason
Hey everyone, I run a website that sells videogames, and different games have different registration systems, so I have a database design that goes something like this: registration_type enum('none', 'regtype1', 'regtype2') products(product_id, registration_type) order_item(order_id, produ

Re: [GENERAL] Database design for separate tsearch table

2008-10-23 Thread Ivan Sergio Borgonovo
On Thu, 23 Oct 2008 14:20:49 +0200 Mikkel Høgh <[EMAIL PROTECTED]> wrote: > >but it seem that just searching on a tsvector in maintable > >build up with > > > >setweight(to_tsvector('pg_catalog.english', > >coalesce(maintable.body,'')), 'A') || ' ' || > > > >setweight(to_tsvector('pg_catalog.engli

Re: [GENERAL] Database design for separate tsearch table

2008-10-23 Thread Mikkel H??gh
On Thu, Oct 23, 2008 at 01:06:26AM +0200, Ivan Sergio Borgonovo wrote: weight them and you'll be able to search by field and "globally". I didn't make any scientific test but I previously had something like: create table subtable ( subtableid int, body text, ftidx tsvector ) create table mai

Re: [GENERAL] Database design for separate tsearch table

2008-10-22 Thread Ivan Sergio Borgonovo
On Thu, 23 Oct 2008 00:10:19 +0200 Mikkel Høgh <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to make a module allowing Drupal to take advantage of > PostgreSQL's excellent Full Text Search, aka. tsearch. > Since this module will probably not become part of Drupal core > right off the bat, I need

[GENERAL] Database design for separate tsearch table

2008-10-22 Thread Mikkel H??gh
Hi, I'm trying to make a module allowing Drupal to take advantage of PostgreSQL's excellent Full Text Search, aka. tsearch. Since this module will probably not become part of Drupal core right off the bat, I need to do this without modifying Drupal's own tables, so I've created a new one for the

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-19 Thread Shane Ambler
David wrote: Later, you need to add an 'employed' boolean field, to reflect whether an employee is still working at the company Your new apps know the difference between employed and unemployed employee, but old apps all assume that all employees in the table are currently employed, and will wa

Re: [GENERAL] Database design: Storing app defaults

2008-06-19 Thread Shane Ambler
David wrote: One (of the many) dubious thing with the above schema, is that NULL employee.salary and employee.benefits_id means that apps should use a default from somewhere else (but this is not immediately obvious from the schema alone). So I would probably use a COALESCE and sub-query to get

Re: [GENERAL] Database design: Data synchronization

2008-06-19 Thread Decibel!
On Jun 18, 2008, at 7:07 AM, David wrote: - Many foreign keys weren't enforced - Some fields needed special treatment (eg: should be unique, or behave like a foreign key ref, even if db schema doesn't specify it. In other cases they need to be updated during the migration). - Most auto-incremen

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-19 Thread David
Thanks for you reply. On Wed, Jun 18, 2008 at 9:15 PM, Shane Ambler <[EMAIL PROTECTED]> wrote: > David wrote: >> >> Hi list. >> >> If you have an existing table, and apps which use it, then how do you >> add new fields to the table (for new apps), but which might affect >> existing apps negatively

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-19 Thread David
>> Problem with this is that some RDBMS (Postgresql specifically) don't >> let you run update statements on views. > > Given 1) the view will be "fairly uncomplicated" and hence > "fairly straightforward" ON INSERT/UPDATE/DELETE rule can > likely be added to it allowing for an apparently writable >

Re: [GENERAL] Database design: Storing app defaults

2008-06-19 Thread David
On Wed, Jun 18, 2008 at 9:30 PM, Shane Ambler <[EMAIL PROTECTED]> wrote: > David wrote: >> >> Hi list. >> >> If you have a table like this: >> >> table1 >> - id >> - field1 >> - field2 >> - field3 >> >> table2 >> - id >> - table1_id >> - field1 >> - field2 >> - field3 >> >> table1 & table2

Re: [GENERAL] Database design: Storing app defaults

2008-06-19 Thread David
On Wed, Jun 18, 2008 at 3:24 PM, Jonathan Bond-Caron <[EMAIL PROTECTED]> wrote: > Application defaults go in the application code not in the database (my > opinion). That's fine, until you want the defaults to be customizable, without making an new app version. That's what my question is about :-)

Re: [GENERAL] Database design: Temporal databases

2008-06-18 Thread Jeff Davis
On Wed, 2008-06-18 at 14:05 +0200, David wrote: > How well do temporal databases work? Do RDBMS (ie Postgresql) need > add-ons to make it effective, or can you just add extra temporal > columns to all your tables and add them to your app queries? Does this > increase app complexity and increase ser

Re: [GENERAL] Database design: Storing app defaults

2008-06-18 Thread Shane Ambler
David wrote: Hi list. If you have a table like this: table1 - id - field1 - field2 - field3 table2 - id - table1_id - field1 - field2 - field3 table1 & table2 are setup as 1-to-many. If I want to start providing user-customizable defaults to the database (ie, we don't want apps to u

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-18 Thread Shane Ambler
David wrote: Hi list. If you have an existing table, and apps which use it, then how do you add new fields to the table (for new apps), but which might affect existing apps negatively? If you know you are going to add a column then add it now and just not have your app do anything with any d

Re: [GENERAL] Database design: Storing app defaults

2008-06-18 Thread Jonathan Bond-Caron
ssue. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Sent: June 18, 2008 8:03 AM To: pgsql-general@postgresql.org Subject: [GENERAL] Database design: Storing app defaults Hi list. If you have a table like this: table1 - id - field1 - field2 - field

Re: [GENERAL] Database design: Temporal databases

2008-06-18 Thread Richard Broersma
On Wed, Jun 18, 2008 at 5:05 AM, David <[EMAIL PROTECTED]> wrote: > I haven't used them before, but I like the idea of never > deleting/updating records so you have a complete history (a bit like > source code version control). Well depending on what kind of temporal behavior you are modeling, th

Re: [GENERAL] Database design: Storing app defaults

2008-06-18 Thread David
On Wed, Jun 18, 2008 at 2:20 PM, Karsten Hilbert <[EMAIL PROTECTED]> wrote: > On Wed, Jun 18, 2008 at 02:03:05PM +0200, David wrote: > >> If I want to start providing user-customizable defaults to the >> database (ie, we don't want apps to update database schema), is it ok >> database design to add

Re: [GENERAL] Database design: Storing app defaults

2008-06-18 Thread Sam Mason
On Wed, Jun 18, 2008 at 02:03:05PM +0200, David wrote: > If I want to start providing user-customizable defaults to the > database (ie, we don't want apps to update database schema), is it ok > database design to add a table2 record, with a NULL table1_id field? > > 2) Have a new table, just for d

Re: [GENERAL] Database design: Storing app defaults

2008-06-18 Thread Karsten Hilbert
On Wed, Jun 18, 2008 at 02:03:05PM +0200, David wrote: > If I want to start providing user-customizable defaults to the > database (ie, we don't want apps to update database schema), is it ok > database design to add a table2 record, with a NULL table1_id field? > > In other words, if table1 has

Re: [GENERAL] Database design: Backwards-compatible field addition

2008-06-18 Thread Karsten Hilbert
On Wed, Jun 18, 2008 at 02:04:14PM +0200, David wrote: > 1) table1 becomes a view of an updated table, with a 'WHERE field4 IS > NULL' clause. > > Problem with this is that some RDBMS (Postgresql specifically) don't > let you run update statements on views. Given 1) the view will be "fairly unco

[GENERAL] Database design: Data synchronization

2008-06-18 Thread David
Hi list. 2 cases I'm interested in: 1) Migrating data from one database to another 2) Distributing data over many databases, and later merging In what ways can you design tables to easier facilitate the above cases? I am aware of multi-master replication software, as described here: http://en

[GENERAL] Database design: Temporal databases

2008-06-18 Thread David
Hi list. Some background information on the subject: http://en.wikipedia.org/wiki/Temporal_database I haven't used them before, but I like the idea of never deleting/updating records so you have a complete history (a bit like source code version control). How well do temporal databases work? Do

[GENERAL] Database design: Backwards-compatible field addition

2008-06-18 Thread David
Hi list. If you have an existing table, and apps which use it, then how do you add new fields to the table (for new apps), but which might affect existing apps negatively? eg: I start with a table like this: table1 - id - field1 - field2 - field3 Later, I want to add a use case, where there

[GENERAL] Database design: Storing app defaults

2008-06-18 Thread David
Hi list. If you have a table like this: table1 - id - field1 - field2 - field3 table2 - id - table1_id - field1 - field2 - field3 table1 & table2 are setup as 1-to-many. If I want to start providing user-customizable defaults to the database (ie, we don't want apps to update database

Re: [GENERAL] Database design questions

2008-06-18 Thread David
Hi list. I'm closing this thread, and will re-post as separate questions. I agree with Jorge that smaller mails will be easier to read. David. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-ge

Re: [GENERAL] Database design questions

2008-06-18 Thread David
On Wed, Jun 18, 2008 at 12:25 PM, Jorge Godoy <[EMAIL PROTECTED]> wrote: > On Wednesday 18 June 2008 05:43:25 David wrote: >> * Should I split this into separate threads instead of 1 thread for >> all my questions? > > I would submit all of the questions in separate messages. It is tiresome to > r

Re: [GENERAL] Database design questions

2008-06-18 Thread Jorge Godoy
On Wednesday 18 June 2008 05:43:25 David wrote: > Hi list. > > There are some database design-related issues I've pondered about for some > time. > > But first: > > * Is this the correct list to ask these questions on? > > * Should I split this into separate threads instead of 1 thread for > all my

[GENERAL] Database design questions

2008-06-18 Thread David
Hi list. There are some database design-related issues I've pondered about for some time. But first: * Is this the correct list to ask these questions on? * Should I split this into separate threads instead of 1 thread for all my questions? Assuming there isn't a problem, here are my questions

Re: [GENERAL] Database design : international postal address

2007-07-18 Thread Pavel Stehule
Hello http://www.bitboost.com/ref/international-address-formats.html http://www.census.gov/geo/www/standards/scdd/AddressStandardV2_April%2017_2003.htm Rock solid solution will be propably too heavy. Propably you can find some more national specific sources. Regards Pavel 2007/7/19, Bruno La

[GENERAL] Database design : international postal address

2007-07-18 Thread Bruno Lavoie
Hello guys, I am currently designing a database which has several tables (e.g. a Customer table) which include address information such as street address, city, state, country code, and zip code, and phone number information in each record. We need to make the schema for these tables sufficie

Re: [GENERAL] Database design wisdom needed

2007-06-05 Thread Andrew Sullivan
On Tue, Jun 05, 2007 at 01:46:42PM +0800, Erick Papadakis wrote: > >GAME_COUNTS Table (also ~5 million rows of course) >--- >GAME_ID >VIEWS_COUNT >PLAYED_COUNT >PLAYED_COUNT_UNIQUE This is a poor normalisation. While views_c

Re: [GENERAL] Database design wisdom needed

2007-06-05 Thread Ron Johnson
On 06/05/07 00:46, Erick Papadakis wrote: Hi Sorry for this somewhat long email but I think it is relevant to most people who run online databases. I am having trouble optimizing UPDATE queries on a certain semi-large table that is only growing larger. I've come across some very interesting thou

[GENERAL] Database design wisdom needed

2007-06-05 Thread Erick Papadakis
Hi Sorry for this somewhat long email but I think it is relevant to most people who run online databases. I am having trouble optimizing UPDATE queries on a certain semi-large table that is only growing larger. I've come across some very interesting thoughts from this list, so I thought I'll post

Re: [GENERAL] database design and refactoring

2007-01-04 Thread Erik Jones
Michael Glaesemann wrote: On Jan 3, 2007, at 5:24 , Luca Ferrari wrote: And moreover a database design question: is a better idea to choose always (when possible) numeric keys? Depends on your requirements. This is an oft-discussed topic about which you can find many more opinions by googli

Re: [GENERAL] database design and refactoring

2007-01-04 Thread Michael Glaesemann
On Jan 3, 2007, at 5:24 , Luca Ferrari wrote: Running the database, the users decided to place numbers as strings, so values like 00110002 and so on. Note that '00110002' is not a number (i.e., it's not equal to 110002): it's a string of digits. is there a tool or a way to easily do su

[GENERAL] database design and refactoring

2007-01-03 Thread Luca Ferrari
Hi all, in my database I've got a table with a key that is char string, since it was supposed to support values like strings. Running the database, the users decided to place numbers as strings, so values like 00110002 and so on. Now I was wondering to refactor my database and change the char fie

Re: RE : Re: [GENERAL] database design ...

2006-11-15 Thread Brent Wood
Raymond O'Donnell wrote: Apologies, my reply should have gone to the list. To answer your question, the sort of thing I'm thinking of is the case where, maybe, one copy of a book is missing a page or two (not unknown in a school library) - the first scenario can't record this, nor can it tell wh

Re: RE : Re: [GENERAL] database design ...

2006-11-15 Thread Jorge Godoy
Shane Ambler <[EMAIL PROTECTED]> writes: > I have only had a little exposure to barcode scanners - the one that a client > used just behaved as a keyboard, so there was no programming to support it, Besides this model there are also models that plug into the serial port and also USB ports. For b

RE : Re: RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true Excellent.. thank you for that!   D.Shane Ambler <[EMAIL PROTECTED]> a écrit : Desmond Coughlan wrote:> X-No-Archive: true> > Just had a thought. If you see .. > > http://www.chez.com/desmondcoughlan/unix/cdi_gt.sqlWith the ISBN number you may want to look at contrib/isn - th

Re: RE : Re: [GENERAL] database design ...

2006-11-14 Thread Shane Ambler
Desmond Coughlan wrote: X-No-Archive: true Just had a thought. If you see .. http://www.chez.com/desmondcoughlan/unix/cdi_gt.sql With the ISBN number you may want to look at contrib/isn - this adds ISBN types. If not then varchar(12) won't hold the new ISBN-13 format that is in

Re: RE : Re: [GENERAL] database design ...

2006-11-14 Thread Shane Ambler
Desmond Coughlan wrote: And our ultimate aim is for a barcode reader to be used by the librarian. > Any good sources to learn about that ? I have only had a little exposure to barcode scanners - the one that a client used just behaved as a keyboard, so there was no programming to support it

RE : Re: RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true   A really weird thing.  This ..   http://www.chez.com/desmondcoughlan/unix/bibliotheque.sql   .. works almost perfectly.  Except for this error ..   'psql:/usr/local/pgsql/bibliotheque.sql:54: ERROR:  relation "titles" does not exist'   I wrote   http://www.chez.c

RE : Re: RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true   More tables and fewer columns in the tables?  I *like* it!  It hadn't occurred to me do it that way.   Will this work ?   http://www.chez.com/desmondcoughlan/unix/bibliotheque.sql   I haven't tested it yet, which brings me to two questions...   a. will it work even

Re: [GENERAL] database design ...

2006-11-14 Thread Noel Faux
Hi, Have you added the ability to store reservations, if a book is out. Maybe having a table for this, requests/reservations id pk user_id fk item_id fk date_requested (so that the first person on the list for this book is notified) Also, I'll assume there is more than one book per title, thu

RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true   Just had a thought.  If you see ..   http://www.chez.com/desmondcoughlan/unix/cdi_gt.sql   .. I'd planned to have one table 'stock' and a column in that table for 'format', as we have books, CDs, DVDs, etc...   What about if I had a separate table for books, another f

RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true   OK, I think I understand.  So the *.sql file that I provided doesn't need to be changed per se, as in the 'stock' table is OK (maybe change it 'stock_general')?  I'd just add another table, with a foreign key 'pointing' back to 'stocks_general'... and a sequence, of course, s

RE : Re: [GENERAL] database design ...

2006-11-14 Thread Raymond O'Donnell
Apologies, my reply should have gone to the list. To answer your question, the sort of thing I'm thinking of is the case where, maybe, one copy of a book is missing a page or two (not unknown in a school library) - the first scenario can't record this, nor can it tell which unlucky borrower ended

RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true   Thanks.  The main uses will be ..   1. available on www to query catalogue (open to everyone) 2 avail. from the web for teachers and students to check their library account (necessitates an account) 3. available in the library itself both on a web interface (to allow the

Re: [GENERAL] database design ...

2006-11-14 Thread Erik Jones
And, when coming up with the use cases you should be working with the people who will actually be using the application. Wrt barcode scanners, they typically just translate the barcode into a number. So, you'll need a barcode printer to print barcodes for your ids to put on the books. Ben w

Re: [GENERAL] database design ...

2006-11-14 Thread Ben
It depends how you plan to use it? Maybe a helpful excercise for you to go through is to come up with some use cases and see if you are storing all the data you'll need in a way that makes it easy for you to use. On Tue, 14 Nov 2006, Desmond Coughlan wrote: X-No-Archive: true Hi, Thanks

RE : Re: [GENERAL] database design ...

2006-11-14 Thread Desmond Coughlan
X-No-Archive: true Good advice... and no, the 'four tables' was a typo;  :)  So far, there are only three...   I reckon we're not going to split stock into two tables, but your point raises an important question.  If I look over my shoulder, say we take Spanish books.  There are six or seven co

Re: [GENERAL] database design ...

2006-11-14 Thread Shane Ambler
Desmond Coughlan wrote: X-No-Archive: true Hi, Thanks for all the help: we have our postgreSQL server on a 'backend' machine, and the client on a webserver. The application I want to develop is a school library, and as this is new to me, I come looking for ideas. Here's what I've

  1   2   >