Re: Four questions
От | greg@turnstep.com |
---|---|
Тема | Re: Four questions |
Дата | |
Msg-id | b7420cbf1047e6c7888063b4882d7c02@biglumber.com обсуждение исходный текст |
Ответ на | ... (owner <ivan@psycho.pl>) |
Ответы |
Re: Four questions
|
Список | pgsql-general |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > 1. how can i get count of result's rows where i declare cursor ?? Nothing in DECLARE will tell you this: you will have to do a SELECT COUNT(*) using the same WHERE clause as the DECLARE to figure this out. You can always set aside a set amount of memory and only FETCH that many rows each time of course: FETCH 23 FROM mycursor; > 2. I sometime select look like for example select 123 as "Foo 3" , 456 as > "Foo 4 ... ", and writing where is fanny.. in select should be somthing > like [] what == name of col. select would look : "select 232 as "QWE RTYU" > where [1] LIKE 'QWE%'; like in C or C++ or in any other lang. You can use aliases in the WHERE clause, but you must be careful about it. Not sure what you are asking here, maybe you could ask again with a different example? > 3. Good thing will be to have somthing like suid in functions. When I do > select some_func ('arg1', 2 ,3 ) ; function should read table, and all > object like owner of this function. Functions are run with the same privileges as the user that calls it by default. You can change this by adding "SECURITY DEFINER" when creating the function: http://www.gtsm.com:81/cgi/psearch?page=sql-createfunction.html;q=security;j=on;c=0;h=1 4. Is possible to bring pg_hba.conf to db, in to pg_* tables ?? I'm sure someone has done this, but I don't have a pointer handy. - -- Greg Sabino Mullane greg@turnstep.com PGP Key: 0x14964AC8 200302190932 -----BEGIN PGP SIGNATURE----- Comment: http://www.turnstep.com/pgp.html iD8DBQE+U5rrvJuQZxSWSsgRAs5AAJ4vRL4NCOBDvaGbj9n/gzhoml8hoQCguc8N Nua9LrCzWXwEkDXDcuPsoAw= =YMny -----END PGP SIGNATURE-----
В списке pgsql-general по дате отправления: