Re: Separate Sessions?? (View data <-> Query tool) - Mailing list pgadmin-support

From Csaba Együd
Subject Re: Separate Sessions?? (View data <-> Query tool)
Date
Msg-id ggm9g6$1csb$1@news.hub.org
Whole thread Raw
In response to Re: Separate Sessions?? (View data <-> Query tool)  ("Willy-Bas Loos" <willybas@gmail.com>)
Responses Re: Separate Sessions?? (View data <-> Query tool)  ("Willy-Bas Loos" <willybas@gmail.com>)
List pgadmin-support
""Willy-Bas Loos"" <willybas@gmail.com> a következoket írta üzenetében 
news:1dd6057e0811270036s67a6b8baqda17273b0484e53d@mail.gmail.com...
>The problem is that my triggers refuse modifying a record if a given Temp 
>table is not created before, because one or more fields have their default 
>values from that temp table

So why don't you either use a normal table, or if you need simultaneous use 
of the trigger with different values, use an array instead of a table. Or 
you might create the temp table in the trigger function..
If you create a normal table you can still delete it afterwards.

hth
WBL
-- 
"Patriotism is the conviction that your country is superior to all others 
because you were born in it." -- George Bernard Shaw

Willy,
you are right but... this is a bit difficult but I try to explain. I develop 
an office management software which uses Postgres as a RDB server. This 
software has to handle many firms separately but by design it has to use 
only one database (customer requirement) so I had to find out a solid way to 
separate the firms form each other. I find out that I qualify every 
firm-dependent record with a firmid.

After logging in the client software will create a TEMP table in which it 
stores the selected firmid. This TEMP table will live durring the login 
session. After this point every views will filter to this firmid and won't 
give back other firms' data just this. I know that other client softwares 
will be able to select data from the tables. (Unfortunatelly I don't know a 
way to revoke select right from a table while a view can select from it... 
Do you know such thing?) Because of this I know that the clean way would be 
using separate databases for separate firms but this was not my decision. 
:( If you know a setting which can improve the security pleas let me know.

Also I had to assure that the INSERT and UPDATE operations will only work 
for the selected firm and the user won't be able to potter with other firms' 
data even not accidentally. This is done in triggers and this causes my 
"View data tool" problem because viewing is possible but modifying is 
enabled only when a firmid is set in the TEMP table.

BTW, I can use script templates with Query tool (like INSERT or UPDATE 
script) which are very handy.

Thx,

-- 
Best Regards,
Csaba Együd
IN-FO Studio 



pgadmin-support by date:

Previous
From: "Willy-Bas Loos"
Date:
Subject: Re: Separate Sessions?? (View data <-> Query tool)
Next
From: "Willy-Bas Loos"
Date:
Subject: Re: Separate Sessions?? (View data <-> Query tool)