Re: [GENERAL] plpython return setof and yield

2009-08-17 Thread Nuno Mota
Ok, now I think I understand since I already have a result set from the query I cannot use yield. The other example works because I am generating only one result set. On Mon, Aug 17, 2009 at 7:55 PM, Nuno Mota wrote: > I have fixed the problem populating a list and returning it. > &g

Re: [GENERAL] plpython return setof and yield

2009-08-17 Thread Nuno Mota
I have fixed the problem populating a list and returning it. Well I guess I have to learn a litte bit more of python to understand how to use yield when using multiple result sets. Thank you anyway On Mon, Aug 17, 2009 at 7:23 PM, Adrian Klaver wrote: > > > ----- "Nun

Re: [GENERAL] plpython return setof and yield

2009-08-17 Thread Nuno Mota
Thank you very much, Can i ask one more question ? How do I declare the correct result set to return, this in first example code, is it possible ? Thank you again, Nuno Mota On Mon, Aug 17, 2009 at 3:21 PM, Adrian Klaver wrote: > On Sunday 16 August 2009 5:13:51 pm Nuno Mota wrote: >

[GENERAL] plpython return setof and yield

2009-08-16 Thread Nuno Mota
for article in range(10) : for other in range(10) : if (other == 1) : continue yield([article,other]) $$LANGUAGE plpythonu; When executing the function on the psql console I always the this error. netbo-dev=# select * from greet('Nuno'); ERROR: error fetching next

[GENERAL] can i recover the database to a certain point...

2007-05-28 Thread nuno
hello. i deleted and recreated a db with the same name. is it possible to recover the database back to where it was before i deleted it? i'd like to find this out first before i try to do some recovery process. thanks a lot. ---(end of broadcast)-

Re: [GENERAL] error msg when pg_restore

2006-08-23 Thread nuno
pg_database_size(oid), public.pg_dir_ls(text, boolean), etc. every single message is one of the types specified above. i read the posts about pg_restore, and i still haven't been able to figure it out. any clue anyone? nuno wrote: > hi, there, tom. thank you for your help. > > i turned -

Re: [GENERAL] error msg when pg_restore

2006-08-23 Thread nuno
r/dbsize', 'relation_size' LANGUAGE c STRICT; the options i am currently using are -i (ignore-version), -h (host), -d (database), -U (user) and -W (password). is there any way you can fix this problem? thanks, nuno Tom Lane wrote: > "nuno" <[EMAIL PROTECTED]> writ

[GENERAL] error msg when pg_restore

2006-08-22 Thread nuno
ad these errors. and i don't think they are meaningful at all as i said earlied there is no data lost in the database. does anyone know how to turn this checking off so that i don't see messages like them anymore. thanks very much for your time. regards, nuno ---

[GENERAL] having indexes when clearing tables

2006-07-11 Thread nuno
tion is that would having indexes increase query performance when clearing tables? or could anyone suggest me any ways to increase performance of the query in such cases? thanks very much. regards, nuno ---(end of broadcast)--- TIP 4: Have you s

[GENERAL] sql question; checks if data already exists before inserted

2006-06-21 Thread nuno
hi, there. i'm trying to write a SQL statement which does the following things. 1. checks if data already exists in the database 2. if not, insert data into database otherwise skip. for example, i'd like to insert a student called 'Michael Jordan' whose ID is 'JORDANMICHAEL' only if the id, 'JORD

Re: [GENERAL] column order

2006-05-25 Thread nuno
hi, all. thanks for the replies. yes, i meant 'columns' not 'rows'. sorry if i made you a bit confused. my explanation should've been more descriptive than that i suppose. anyway, it's good to know that postgresql guarantees the column order. i was just trying to be double-safe before i mess up w

[GENERAL] column order

2006-05-24 Thread nuno
hi, all. i have a couple of questions regarding the order of table columns. say, you have a following query; SELECT id, firstname, lastname, dob FROM student; does postgresql guarantee you that the columns in the result set would be ordered as specified in the query (i.e. id, firstname, lastname

[GENERAL] Executing a query and returning the result set using the SPI

2004-01-31 Thread Nuno Morgadinho
the tuple into a datum */ result = TupleGetDatum(slot, tuple); /* Clean up (this is not actually necessary) */ pfree(values[0]); pfree(values[1]); pfree(values[2]); pfree(values); SRF_RETURN_NEXT(funcctx, result); } e

[GENERAL] Executing a query and returning the result set using the SPI

2004-01-26 Thread Nuno Morgadinho
the tuple into a datum */ result = TupleGetDatum(slot, tuple); /* Clean up (this is not actually necessary) */ pfree(values[0]); pfree(values[1]); pfree(values[2]); pfree(values); SRF_RETURN_NEXT(funcctx, result); } e