Re: [SQL] record datatype comparisons

2006-11-01 Thread Volkan YAZICI
On Nov 01 09:28, Andrew Sullivan wrote: > On Tue, Oct 31, 2006 at 11:45:00PM +0200, Volkan YAZICI wrote: > > > Note the column headers. They're differently shaped. Because > > > pseudotype record doesn't have a shape, equality doesn't make sense, > > > so you need two shapes that are already iden

Re: [SQL] record datatype comparisons

2006-11-01 Thread Andrew Sullivan
On Wed, Nov 01, 2006 at 11:00:04PM +0200, Volkan YAZICI wrote: > But there should be a way to reach the types of the attributes of the > record data type. Otherwise, how would it be possible to place it into > another tuple as an attribute. Well, surely there is, but that has to happen at assignm

[SQL] Statement Triggers and access to other rows in the transaction

2006-11-01 Thread Craig Servin
I have tables representing a ledger system and the accounts on which it operates. I want to do 2 things to all transactions altering the ledger tables. First, all of the inserts into the ledger tables should be balanced ( They should sum to 0 ). If not I want to abort the transaction. Second,

Re: [SQL] record datatype comparisons

2006-11-01 Thread Andrew Sullivan
On Tue, Oct 31, 2006 at 11:58:08PM +0200, Volkan YAZICI wrote: > On Oct 31 06:49, Alvaro Herrera wrote: > > > select > > > (select (1,2)) > > > is distinct from > > > (select (1,2)) > > > ; > > alvherre=# select > > row(1,2) > > is distinct from > > row(1,2) > > What's the difference

Re: [SQL] record datatype comparisons

2006-11-01 Thread Andrew Sullivan
On Tue, Oct 31, 2006 at 11:45:00PM +0200, Volkan YAZICI wrote: > > > > Note the column headers. They're differently shaped. Because > > pseudotype record doesn't have a shape, equality doesn't make sense, > > so you need two shapes that are already identical, so they can use > > the matching rul

Re: [SQL] Round Numeric Type

2006-11-01 Thread Ezequias Rodrigues da Rocha
Numeric(9,2)2006/10/31, Andrew Sullivan <[EMAIL PROTECTED]>: On Tue, Oct 31, 2006 at 05:35:17PM -0200, Ezequias Rodrigues da Rocha wrote:> Hi list,>> I did a trigger to update a points on a table but in some cases the> PostgreSQL does a round of my Numeric like. >> If >= 0.5 so postgresql puts 1> I