[SQL] locks and triggers. give me an advice please

2004-07-19 Thread sad
Good day. often, I am turning triggers off and on to perform a mass operation on a table, and i am interested how should i care of another user operations. the scene is: table t1 with user defined triggers and many tables reference t1, (so FK triggers defined on t1) the operation i want to per

Re: [SQL] Group by failing on Null values

2004-07-19 Thread Rosser Schwarz
while you weren't looking, Caleb Simonyi-Gindele <[EMAIL PROTECTED]> wrote: > How do I get it to produce a row even when dat_staff_code is null? try something like SELECT coalesce(dat_staff_code, 0)...GROUP BY dat_staff_code That will substitute a zero for any NULL value in that column, which G

[SQL] Group by failing on Null values

2004-07-19 Thread Caleb Simonyi-Gindele
I have a SELECT query that basically adds up my sales, removes credit adjustments (eg. Returns) and gives the net figure.   This is the query: SELECT (SELECT SUM(cli_tran_amount) FROM vetpmardet WHERE cli_credit_adj_trans_no IN (SELECT sys_tran_number from vetpmardet WHERE cli_tran_trans

Re: [SQL] C++ interface problem with libpq.so.3

2004-07-19 Thread Tom Lane
Kemin Zhou <[EMAIL PROTECTED]> writes: > I have writte a simple program to access PGDB from a C++ program using > the libpq++-4.0 > Most of time it runs perfect. This morning, it was working fine. Then > later it stopped working. > The symptom is that my program went to asleep. Looks to me lik

[SQL] C++ interface problem with libpq.so.3

2004-07-19 Thread Kemin Zhou
I have writte a simple program to access PGDB from a C++ program using the libpq++-4.0 Most of time it runs perfect. This morning, it was working fine. Then later it stopped working. The symptom is that my program went to asleep. The stack trace: #0 0xe002 in ?? () #1 0x40120808 in pqSo

Re: [SQL] Problem in age on a dates interval

2004-07-19 Thread Alexander M. Pravking
On Mon, Jul 19, 2004 at 10:00:50AM +0100, Luis Sousa wrote: > I worked around this problem returning the difference between the two > dates, using extract doy from both. > Anyway, this will cause a bug on my code when changing the year. Any ideas? Why don't you use the minus operator? SELECT '20

Re: [SQL] Problem in age on a dates interval

2004-07-19 Thread Luis Sousa
I worked around this problem returning the difference between the two dates, using extract doy from both. Anyway, this will cause a bug on my code when changing the year. Any ideas? Best regards, Luis Sousa Tom Lane wrote: Theodore Petrosky <[EMAIL PROTECTED]> writes: wow at first I though

Re: [SQL] How do I convice postgres to use an index?

2004-07-19 Thread SZUCS Gabor
re-checked; it's WITHOUT in both version, but it's irrelevant if you give the full spec. Well, then maybe it was a difference between 7.2 and 7.3, but again, it's irrelevant in your case. Have you tried the typecast? G. %--- cut here ---% \end - Origina