Re: [HACKERS] unchecked malloc

2005-09-27 Thread Sibtay Abbas
This dicussion reminds me of a possible memory leak in plpgsql's code. In case you are interested in it; in pl_comp.c, plpgsql_build_variable takes a pointer to a PLpgSQL_type structure, which is always a malloc'ed instance(since we always use plpgsql_build_datatype function). The switch

Re: [HACKERS] getting oid of function

2005-02-15 Thread Sibtay Abbas
On Tue, 15 Feb 2005 14:55:38 +1100, Neil Conway [EMAIL PROTECTED] wrote: On Mon, 2005-02-14 at 17:02 +0500, Sibtay Abbas wrote: thank you for the detailed reply But what i wanted to know is that how can we actually get a function's oid from its name from within postgresql code itself You'll

Re: [HACKERS] getting oid of function

2005-02-14 Thread Sibtay Abbas
approach I would be thankful if anyone can correct me. On Mon, 14 Feb 2005 01:14:07 -0700, Michael Fuhr [EMAIL PROTECTED] wrote: On Mon, Feb 14, 2005 at 12:47:44PM +0500, Sibtay Abbas wrote: Is it possible to get the oid of a function on the basis of its name?. One way is to cast the function

[HACKERS] getting oid of function

2005-02-13 Thread Sibtay Abbas
Hello all Is it possible to get the oid of a function on the basis of its name?. The scenario which i am currently facing is that i have the function name, now i want search the pg_proc system catalog on the basis of the function name and retrieve its Oid. Another confusion which i am facing is

[HACKERS] passing parameters by reference

2005-02-11 Thread Sibtay Abbas
hello all as i have mentioned this before, as part of my academic project i am required to make modifications in postgresql. One of my tasks includes allowing plpgsql functions to pass parameters by reference. For this purpose I have been digging in the code for plpgsql and postgresql for 2

[HACKERS] storage of compiled functions

2005-01-27 Thread Sibtay Abbas
Hello everyone i have been studying postgres's function handling philosophy lately. I got stuck at a point where i could'nt get the answer myself All the information related to functions are stored in pg_proc system catalog. But when a function is compiled (probably the data structure that

[HACKERS] exception handling in plpgsql

2004-12-31 Thread Sibtay Abbas
hello I am using the following sytex to handle exceptions in plpgsql (I am using postgres 8 rc1) some code EXCEPTION WHEN NO_DATA THEN RAISE NOTICE 'NO DATA'; WHEN OTHERS THEN RAISE NOTICE 'An exception occurred'; RETURN emp_rec; and i receive

[HACKERS] CreateFunctionStmt struct

2004-12-23 Thread Sibtay Abbas
hello, typedef struct CreateFunctionStmt { NodeTag type; boolreplace; List *funcname; List *parameters; TypeName *returnType; List *options;

[HACKERS] cant execute yyparse() within postgresql

2004-12-21 Thread Sibtay Abbas
hello i am not able to execute the yyparse() function generated by flex from within the pl call handler function. does any one knows the reason for this failure? and how can it be rectified thank you __ Do you Yahoo!? Send a seasonal email

Re: [HACKERS] cant execute yyparse() within postgresql

2004-12-21 Thread Sibtay Abbas
is to ask him the details instead of trying to insult him. thank you --- Peter Eisentraut [EMAIL PROTECTED] wrote: Sibtay Abbas wrote: i am not able to execute the yyparse() function generated by flex from within the pl call handler function. First of all, flex does not generate a yyparse

Re: [HACKERS] cant execute yyparse() within postgresql

2004-12-21 Thread Sibtay Abbas
Datum mylanguage_handler(PG_FUNCTION_ARGS){ if (CALLED_AS_TRIGGER(fcinfo)) /*do nothing else{ char *proc_source; Datum prosrcdatum; boolisnull; //get the oid of the function

[HACKERS] yyin's value of postgresql parser

2004-12-19 Thread Sibtay Abbas
hello what is the value of yyin variable for postgresql parser. It might be the default(stdout) when postgresql is in interactive backend mode...but what happens when clients from different workstations sends their queries? __ Do you Yahoo!?

[HACKERS] cant write to file within call handler interface

2004-12-14 Thread Sibtay Abbas
hello i am not able to write to file until the pl call handler interface. this is the template which i am following PG_FUNCTION_INFO_V1(my_call_handler); Datum my_call_handler(PG_FUNCTION_ARGS) { ...my code... int fd = open(filename,O_WRONLY);

[HACKERS] old-style handler problem

2004-12-10 Thread Sibtay Abbas
hi everyone i ve added my own pl language in postgresql. i ve followed the process mentioned in the documentation. for the handler function i ve followed the following template PG_FUNCTION_INFO_V1(myhandler); Datum plsample_call_handler(PG_FUNCTION_ARGS) { Datum rv;

[HACKERS] old-style handler error

2004-12-10 Thread Sibtay Abbas
i have added my own pocedural language in postgresql. by using the Create function command i ve also written a procedure in that language. now when invoke that function with SELECT (func_name) i receive the following error message ERROR: language 17254 has old-style handler.

Re: [HACKERS] spi and other languages

2004-12-07 Thread Sibtay Abbas
i am still in my RD phase so i ve not yet tried it. actually i chose the wrong example. We can call SQL statements like SPI_Execute(SELECT * FROM sometable) from the spi interface. My question is that can we enter other procedural languages as well, like pgplsql statements.

[HACKERS] adding procedural languages

2004-12-07 Thread Sibtay Abbas
hi everyone ok i ve tried to add my own procedural language using the call handler interface. I am doining nothing in the handler function except tyring to print a mess through errmsg function (plz correct me if i am wrong here, since i cant see the message which i am printing) Now my question

[HACKERS] Oid?

2004-12-06 Thread Sibtay Abbas
hi everyone i see an attribute 'oid_value' with 'Oid' type in the ListCell union. can anyone tell me what does it represents? Thank you __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more.

[HACKERS] main entry point for queries?

2004-12-06 Thread Sibtay Abbas
hello i am trying to understand the source code of postgresql. Whenever a user enters a query, whether from the Socket end or the interactive back end, which function is always invoked that would start manipulation of that query... i ve noticed that the primitive parsing is done by the

[HACKERS] how can i add my own procedural language?

2004-12-06 Thread Sibtay Abbas
hi is Procedural language handler function the interface for adding your own procedural languages to postgres? I ve read the documentation but i am not able to understand where do we deal with stuff like parse trees, query trees, plan trees etc. Ofcourse any procedural language should pass

[HACKERS] spi and other languages

2004-12-06 Thread Sibtay Abbas
i guess the answer to my previous question was spi...i ve got another question, can we call pgsql or plpgsql functions using spi? like can we do something like SPI_execute(CREATE FUNCTION blah() RETURNS Integer . __ Do you Yahoo!?