now about psql and one function

Started by ivanover 22 years ago3 messages
#1ivan
iv@psycho.pl

in psql , file command.c : 1473 there is a query to check state for
superuser, and this query is in begin/end transaction.
When user dont have perm to read pg_user its fail but transation is never
end, and ist make some confusion because user have to write "END;" or
"ROLLBACK;" themself. I just removed BEGIN and END from this query.

ok, and this function :
create or replace func () returns INT as '
DECLARE
cnt INT;
BEGIN
CREATE TEMP TABLE ble (i INT);
SELECT INTO cnt count(*) FROM ble;
DROP TABLE ble;
RETURN cnt;
END;
' LANGUAGE 'plpgsql';

and at first time everythink is ok, but in next time is error like this :
pg_class_aclcheck : relation <nr> not found .
(This function is only example , and i know that it doesnt sens)
I think its by SysCache, how can i reset it ? or turn off ? or reload ?

#2Bruce Momjian
pgman@candle.pha.pa.us
In reply to: ivan (#1)
Re: now about psql and one function

Why would someone not have the ability to read pg_user? The query is
gone in 7.4 anyway.

---------------------------------------------------------------------------

ivan wrote:

in psql , file command.c : 1473 there is a query to check state for
superuser, and this query is in begin/end transaction.
When user dont have perm to read pg_user its fail but transation is never
end, and ist make some confusion because user have to write "END;" or
"ROLLBACK;" themself. I just removed BEGIN and END from this query.

ok, and this function :
create or replace func () returns INT as '
DECLARE
cnt INT;
BEGIN
CREATE TEMP TABLE ble (i INT);
SELECT INTO cnt count(*) FROM ble;
DROP TABLE ble;
RETURN cnt;
END;
' LANGUAGE 'plpgsql';

and at first time everythink is ok, but in next time is error like this :
pg_class_aclcheck : relation <nr> not found .
(This function is only example , and i know that it doesnt sens)
I think its by SysCache, how can i reset it ? or turn off ? or reload ?

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3ivan
iv@psycho.pl
In reply to: Bruce Momjian (#2)
Re: now about psql and one function

Why postgres should be using only for standard ways ?
I need to protect pg how its possible . Every single informacion which
user dont need to know he can not know . Each user is like enemy . :-)

I worry more about this cache , i dont know how to reset it.
Beca use i (in one transaction) make copy of table, drop it, create new
version and restore rows, but i can not do it because relcache remember
relid of this old table :( its any way to turn it off (for only replaceing
moment) or clien cache list ???? any idea ? (samole function is above)

PS.
Whato do you thing about \I in psql . Its will be like \i but befor
starting read file will be "BEGIN;" and if everythink will be ok will be
"END;" ..... ?
I know that i can do it manualy , but why i should do this when i have
soft as my help :>

On Wed, 30 Jul 2003, Bruce Momjian wrote:

Show quoted text

Why would someone not have the ability to read pg_user? The query is
gone in 7.4 anyway.

---------------------------------------------------------------------------

ivan wrote:

in psql , file command.c : 1473 there is a query to check state for
superuser, and this query is in begin/end transaction.
When user dont have perm to read pg_user its fail but transation is never
end, and ist make some confusion because user have to write "END;" or
"ROLLBACK;" themself. I just removed BEGIN and END from this query.

ok, and this function :
create or replace func () returns INT as '
DECLARE
cnt INT;
BEGIN
CREATE TEMP TABLE ble (i INT);
SELECT INTO cnt count(*) FROM ble;
DROP TABLE ble;
RETURN cnt;
END;
' LANGUAGE 'plpgsql';

and at first time everythink is ok, but in next time is error like this :
pg_class_aclcheck : relation <nr> not found .
(This function is only example , and i know that it doesnt sens)
I think its by SysCache, how can i reset it ? or turn off ? or reload ?

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

--
Bruce Momjian                        |  http://candle.pha.pa.us
pgman@candle.pha.pa.us               |  (610) 359-1001
+  If your life is a hard drive,     |  13 Roberts Road
+  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend