Re: Four questions - Mailing list pgsql-general
From | owner |
---|---|
Subject | Re: Four questions |
Date | |
Msg-id | Pine.LNX.4.44.0302192138220.8394-100000@rex.anfa.pl Whole thread Raw |
In response to | Re: Four questions (greg@turnstep.com) |
Responses |
Re: Four questions
|
List | pgsql-general |
On Wed, 19 Feb 2003 greg@turnstep.com wrote: > > -----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; > hmm, this select its very big select, including many tables and throught func. Making this same query 2 times is without any sens, pointless. I make this select trought libpq, from server to others PC, and every Exec need same time, and befor dowloading rows to client memory i need to know exacly how big is select .... :/ > > 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? > For example i do select and i dont know name of the cols, but i know type, and count of cos, and i want to do what i can do with ORDER : select * from func() where [1] != NULL order by 1; [1] == name of first col in this select > > > 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 > then i can use same func like other user ? > > 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----- > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://archives.postgresql.org >
pgsql-general by date: