Re: [GENERAL] Composite Keys

2007-02-26 Thread RPK
Alvaro, I am using VB.NET. How to enable locking from within VB.NET for PostgreSQL? Which command need to be executed? Alvaro Herrera-7 wrote: > >>Lock the table beforehand. Only one user can be getting the >>max(ReceiptNo) that way. > >>Alternatively, you could use userlocks, so that you c

Re: [GENERAL] Composite Keys

2007-02-26 Thread Alvaro Herrera
RPK wrote: > > Jorge, > > For other tables I have ID field which is incremented by sequence. But for > this table, there is not ID field. Receipt No will be incremented by finding > the max value from the existing Receipt Nos. corresponding to that Book No. > This case has a drawback as compared

Re: [GENERAL] Composite Keys

2007-02-26 Thread RPK
Jorge, For other tables I have ID field which is incremented by sequence. But for this table, there is not ID field. Receipt No will be incremented by finding the max value from the existing Receipt Nos. corresponding to that Book No. This case has a drawback as compared to the sequences in other

Re: [GENERAL] Composite Keys

2007-02-24 Thread Jorge Godoy
Em Sábado 24 Fevereiro 2007 03:28, RPK escreveu: > First, can a primary key field be only one? I mean can I define a primary > containing two fields. > > I have a table called "Payments" where there are two fields, "ReceiptNo" > and "PaymentDate". If I take "ReceiptNo" only as a primary key then ch

Re: [GENERAL] Composite Keys

2007-02-23 Thread Joshua D. Drake
RPK wrote: > First, can a primary key field be only one? I mean can I define a primary > containing two fields. As many as you like :) > > I have a table called "Payments" where there are two fields, "ReceiptNo" and > "PaymentDate". If I take "ReceiptNo" only as a primary key then chances are >

[GENERAL] Composite Keys

2007-02-23 Thread RPK
First, can a primary key field be only one? I mean can I define a primary containing two fields. I have a table called "Payments" where there are two fields, "ReceiptNo" and "PaymentDate". If I take "ReceiptNo" only as a primary key then chances are of "primary key violation". Because in some pl