[SQL] diff value retuns, debug mode and play mode

2005-02-17 Thread AL� �EL�K
I have a postgresql function at the bottom , when i run at EMS POSTGRESQL debug mode with F8 step by step. Its work great but when i use with play button it returns null what is the different about debug mode and run mode. BEST REGARDS. CREATE OR REPLACE FUNCTION "public"."allocatedamount" (v

Re: [SQL] Relation in tables

2005-02-17 Thread lucas
Use a view per department, which show/hide the columns according to your liking. Give each department a schema and put everything related to it inside for cleanliness. Use UPDATE triggers on the views, which in fact write to the products table, so that the departments can only update the column

Re: [SQL] pg primary key bug?

2005-02-17 Thread pginfo
Hi all, Sorry for my post, but I think it is pg primary key bug. It is secont time in that we found the bug (see the replays for this message). We have many server with pg and use it over jdbc + jboss. I am not able to stop this server for long time, but I have dumped the problem table. It

[SQL] No triggers visible for different user in information_schema.triggers

2005-02-17 Thread Oliver Brück
Hello, I am using a postgres 7.4 dbms, a single database DB in the public scheme and two database users USER1 and USER2, both of them having superuser priviliges. USER1 is owner of all tables in the database DB. I have defined triggers on some tables as user USER1, and all of them are shown in

Re: [SQL] pg primary key bug?

2005-02-17 Thread Michael Fuhr
On Thu, Feb 17, 2005 at 04:12:38PM +0100, pginfo wrote: > 01=# select * from a_constants_str where constname='DOCPLAID' ; > constname | fid | constvalue > ---+-+ > DOCPLAID | 0 | SOF_19738 > DOCPLAID | 0 | SOF_19738 > (2 rows) Do you have any inherited tables? What'

Re: [SQL] pg primary key bug?

2005-02-17 Thread pginfo
Hi, No, I do not inherited tables. The result of this query is: 01=# SELECT tableoid::regclass, * 01-# FROM a_constants_str 01-# WHERE constname = 'DOCPLAID';     tableoid | constname | fid | constvalue -+---+-+  a_constants_str | DOCPLAID  |   0 |

Re: [SQL] pg primary key bug?

2005-02-17 Thread Tom Lane
pginfo <[EMAIL PROTECTED]> writes: > 01=# select * from a_constants_str where constname='DOCPLAID' ; > constname | fid | constvalue > ---+-+ > DOCPLAID | 0 | SOF_19738 > DOCPLAID | 0 | SOF_19738 > (2 rows) Could we see the system columns on these rows? sel

Re: [SQL] No triggers visible for different user in information_schema.triggers

2005-02-17 Thread Michael Fuhr
On Thu, Feb 17, 2005 at 04:58:24PM +0100, Oliver Brück wrote: > > SELECT * FROM information_schema.triggers; > > returns an empty result. I thought this is caused by a lack of > priviliges, but USER1 as well as USER2 are superusers. The PostgreSQL documentation defines information_schema.trigge

Re: [SQL] pg primary key bug?

2005-02-17 Thread pginfo
Hi, Tom Lane wrote: pginfo <[EMAIL PROTECTED]> writes: 01=# select * from a_constants_str where constname='DOCPLAID' ; constname | fid | constvalue ---+-+ DOCPLAID | 0 | SOF_19738 DOCPLAID | 0 | SOF_19738 (2 rows) Could we see the system

[SQL] LOOP?

2005-02-17 Thread Ray Madigan
I am writing a trigger to inspect a row of a temporary table to determine if the row has any null columns, I will return as soon as I find a null column. I ran across this in the manual and It seems like I could use The FOR-IN-EXECUTE statement is another way to iterate over rows: [<>] FOR recor

[SQL] Comments on subquery performance

2005-02-17 Thread T- Bone
(second attempt in two days to post this message...I appologise if for some reason a duplicate appears) Hello all, I created a query that contains two subqueries and joins and would like some feedback on whether: 1) this approach is logical; and, 2) if this is an optimal approach (performance

Re: [SQL] LOOP?

2005-02-17 Thread Richard Huxton
Ray Madigan wrote: I am writing a trigger to inspect a row of a temporary table to determine if the row has any null columns, I will return as soon as I find a null column. I ran across this in the manual and It seems like I could use The FOR-IN-EXECUTE statement is another way to iterate over ro

Re: [SQL] pg primary key bug?

2005-02-17 Thread Tom Lane
pginfo <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Could we see the system columns on these rows? > 01=# select oid,xmin,cmin,xmax,cmax,ctid,* from a_constants_str where > constname='DOCPLAID'; > oid | xmin | cmin | xmax | cmax | ctid | constname | fid | > constvalue > ---

Re: [SQL] pg primary key bug?

2005-02-17 Thread pginfo
Hi, Tom Lane wrote: pginfo <[EMAIL PROTECTED]> writes: Tom Lane wrote: Could we see the system columns on these rows? 01=# select oid,xmin,cmin,xmax,cmax,ctid,* from a_constants_str where constname='DOCPLAID'; oid | xmin | cmin

Re: [SQL] pg primary key bug?

2005-02-17 Thread Tom Lane
pginfo <[EMAIL PROTECTED]> writes: > Will upgrade to 8.0 solve this type of problems ? The problem is probably not Postgres' fault at all. I'm wondering about disks with write cacheing enabled. And you didn't turn off fsync, I trust? regards, tom lane --

Re: [SQL] Comments on subquery performance

2005-02-17 Thread Richard Huxton
T- Bone wrote: (second attempt in two days to post this message...I appologise if for some reason a duplicate appears) Hello all, I created a query that contains two subqueries and joins and would like some feedback on whether: 1) this approach is logical; and, 2) if this is an optimal approac

Re: [SQL] pg primary key bug?

2005-02-17 Thread pginfo
Hi, Tom Lane wrote: pginfo <[EMAIL PROTECTED]> writes: Will upgrade to 8.0 solve this type of problems ? The problem is probably not Postgres' fault at all. I'm wondering about disks with write cacheing enabled. And you didn't turn off fsync, I trust? About fsync

Re: [SQL] pg primary key bug?

2005-02-17 Thread Iain
Hi Ivan,   Sorry, I can't remember all you said in earlier posts, but I was wondering, your log file says:   > HINT:  Rebuild the index with REINDEX. Did you do that, and did it solve the problem?   regards Iain - Original Message - From: pginfo To: Tom Lane Cc: [EMAIL P

Re: [SQL] pg primary key bug?

2005-02-17 Thread pginfo
Hi Iain, Iain wrote: Hi Ivan,   Sorry, I can't remember all you said in earlier posts, but I was wondering, your log file says:   > HINT:  Rebuild the index with REINDEX. Did you do that, and did it solve the problem?   No it do not  solve