[HACKERS] Improper usage of MemoryContext in nodeSubplan.c for buildSubPlanHash() function. This maybe causes allocate memory failed.

2010-07-27 Thread Tao Ma
Hi all, This is a potential memory error in nodeSubplan.c or execGrouping.c Using select '1'::TEXT IN ((SELECT '1'::NAME) UNION ALL SELECT '1'::NAME); to reproduce this bug. You may see the memory content that slot1's tts_values[0] point to before and after the statement :

Re: [HACKERS] question about the _SPI_save_plan() and plan cache

2009-08-03 Thread Tao Ma
Tom Lane t...@sss.pgh.pa.us writes: Tao Ma feng_e...@163.com writes: I knew that the delete_function() will reclaim the memory context allocated for the function. But I did not find any code for removing the plan(SPI plan memory context), saved by calling _SPI_save_plan. Hmmm ... good point

[HACKERS] question about the _SPI_save_plan() and plan cache

2009-07-28 Thread Tao Ma
once). Once we DROP the function, the memory consumed by the plan will be leak. The same thing for the compiled function structure(PLpgSQL_function). Is this an oldest known question? Thanks, Tao Ma -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes

Re: [HACKERS] question about the _SPI_save_plan() and plan cache

2009-07-28 Thread Tao Ma
Lane t...@sss.pgh.pa.us wrotes:25310.1248791...@sss.pgh.pa.us... Tao Ma feng_e...@163.com writes: Once we DROP the function, the memory consumed by the plan will be leak. I'm pretty unconcerned about DROP FUNCTION. The case that seems worth worrying about is CREATE OR REPLACE FUNCTION

Re: [HACKERS] question about deparsing const node and its typmod

2009-04-01 Thread Tao Ma
result. Is it possible to omit the bpchar or something like it, if it is a const node for the default value? Tom Lane t...@sss.pgh.pa.us writes:18655.1238258...@sss.pgh.pa.us... Tao Ma feng_e...@163.com writes: CREATE TABLE t (c1 CHAR(5) DEFAULT 'abc', c2 CHAR(5) DEFAULT 'abc

[HACKERS] question about deparsing const node and its typmod

2009-03-28 Thread Tao Ma
the coercion will absence iff the type and typmod is same. Thanks in advance, Tao Ma -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

Re: [HACKERS] question about the design consideration for system catalogs

2009-02-24 Thread Tao Ma
Tom Lane t...@sss.pgh.pa.us wrotes: Tao Ma feng_e...@163.com writes: But if I wanna check the parameter informations, it's a little hard to read. If I wanna write a program to re-construct the procedure source code, it is not convenience to access the parameter informations from the front-end

[HACKERS] question about the design consideration for system catalogs

2009-02-23 Thread Tao Ma
Howdy, I have a question about the design consideration for system catalogs. Some of tables include arrays to hold the variable informations, such as tracking the procedure declaration informations in pg_proc. To store the informations for procedure parameters, there are proargtypes,

[HACKERS] some questions about SELECT FOR UPDATE/SHARE

2009-02-12 Thread Tao Ma
Hi, I noticed Tom Lane made SELECT FOR UPDATE/SHARE work on inheritance trees. But todo list is not updated to reflect this change. http://wiki.postgresql.org/wiki/Todo#Inheritance Actually, there is a patch trying to remove the ONLY clause on the foreign key checks on the inheritance tables.

Re: [HACKERS] why declare arg as a array in FunctionCallInfoData structure

2009-02-03 Thread Tao Ma
Thank you guys... -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers

[HACKERS] why declare arg as a array in FunctionCallInfoData structure

2009-02-02 Thread Tao Ma
hi, When I read the postgresql codes, I noticed that the FunctionCallInfoData structure(declared in the src/include/fmgr.h) contains two arrays 'arg' and 'argnull'. Why don't you declare it as a pointer and allocate the memory from heap? It saves more momery if 'arg' and 'argnull' declares as

[HACKERS] huge query tree cost too much time to copyObject()

2008-11-24 Thread Tao Ma
Hi, recently, I wrote a really complex SELECT statement which consists of about 20 relations using NATURAL JOIN method and every single relation consists 50 columns. It looks like: PREPARE ugly_stmt AS SELECT * FROM t1 NATURAL JOIN t2 NATURAL JOIN t3 ... NATURAL JOIN t20 WHERE id = $1; All