5,406 reputation
433
bio website ledgersmbdev.blogspot.com
location
age 37
visits member for 8 months
seen 4 hours ago
stats profile views 122

I am the most active developer on LedgerSMB.


Mar
14
answered Images, PDF, audio and video files in MySQL
Mar
14
answered Database Relational Design for Multiple Categories
Mar
14
comment How to properly configure pgBouncer transaction level pooling?
What kind of application? Is this a web app? A thick client? If it is a thick client, how many queries are active, usually, at any given point, and how many connections are idle?
Mar
14
answered How to properly configure PostgreSQL RAM usage?
Mar
14
answered Postgres Automated Install
Mar
13
comment Representing SQL constraints on a table
Hint: Think of the subset as a linked list with check constraints and foreign keys to the previous versions (including the running total), and check constraints to ensure the current calculation is correct. I do think the trigger is cleaner. It is possible, however annoying it is though.
Mar
13
comment Representing SQL constraints on a table
the non-declarative solution is cleaner. And the other solutions require, on PostgreSQL at least, some extra constriants to make work but with appropriate unique constraints, foreign keys, self joins, etc, you can ensure running totals can be accurate. This being said, I am not sure it is a net win. The larger issue though is that this is an area which is unnecessarily painful on RDBMS's even when RDBMS's should be capable of more graceful solutions, IMO.
Mar
13
comment how to chain postgres RULEs?
(I would say rules are no longer a standard beginner's tool. They are however a very useful advanced tool once you really get what you are doing.)
Mar
13
comment how to chain postgres RULEs?
Can you include a query plan (explain output). Don't run explain analyse since that will hang. Just standard explain.
Mar
13
comment how to chain postgres RULEs?
Rules are not deprecated in favor of triggers. They are very different and a bit of a hassle to work with. The big reason is that for simple udateable views, they are far more flexible than triggers when it comes to performance tuning. There are many Pg folks who would like them to be deprecated and many more who do not feel they should ever be deprecated.
Mar
13
comment Representing SQL constraints on a table
Also note that the declarative constraints are complicated, requiring self-joins, some duplication of data, and storage of running-totals, or they require fun tricks breaking 1NF.
Mar
13
comment Representing SQL constraints on a table
@ErwinSmout, yes there are a few ways of doing this but they require some db-specific assumptions. See the answers in the linked question. Note the linked question was, essentially "how can I model a constraint such that for any given transaction, sum(amount) = 0 group by gl_id." This case is easier (with the dropped floor condition) because you just have to check that the running sum is less than a certain amount. Note that the SQL Server solutions require additional constraints to work on PostgreSQL.
Mar
12
comment Use single table with foreign key or two twin tables for text entries?
If you rename one field from content to question, and the other from content to answer, and name the tables appropriately that isn't a problem though.
Mar
12
comment Use single table with foreign key or two twin tables for text entries?
Ok, if you have a generic table structure with different meanings it is very hard to ramp up on the db structure. Once I worked with a dbase database with tables like customer1 and customer2, with identical structures, that was intended to be joined the way you expected (and each had 256 fields!). The problem of course is that this isn't obvious, and so it took a lot of trial and error to figure out what any given piece of data meant. In software programming and design, clarity is golden, and generic structures joined in odd ways gets in the way of that. tbc
Mar
12
comment Use single table with foreign key or two twin tables for text entries?
Ick, that's quite a bit worse because the table structure is not self-documenting.
Mar
12
answered Reporting Service and Application Role
Mar
12
comment Representing SQL constraints on a table
@Sam: If you want to do it declaratively, move to a different RDBMS.
Mar
12
answered Representing SQL constraints on a table
Mar
12
answered What is the best way to store X509 certificate in PostgreSQL database?
Mar
12
answered Use single table with foreign key or two twin tables for text entries?