Re: [GENERAL] How to specify/mock the statistic data of tables in PostgreSQL

2014-01-12 Thread Felix .
I see, thanks. I'm looking into the source code of statistic part now, and I'm a little confused about the column staop presented in table pg_statistic, in the pg_statisitc.h, the comment says: /* * To allow keeping statistics on different kinds of datatypes, * we do not

[GENERAL] How are pg_operator and pg_type related with each other?

2014-01-15 Thread Felix .
Hi all, I'm studying pg_statistic table and I find that column staop is related to pg_operator, and different data types relate to different staop, but I don't know where pgsql stores the mapping between pg_type and pg_operator, does anyone have any idea about it? thanks!

Re: [GENERAL] How are pg_operator and pg_type related with each other?

2014-01-15 Thread Felix .
but text[] is found in the query. Thanks very much! 2014/1/15 Amit Langote amitlangot...@gmail.com On Wed, Jan 15, 2014 at 11:08 PM, Felix.徐 ygnhz...@gmail.com wrote: Hi all, I'm studying pg_statistic table and I find that column staop is related to pg_operator, and different data types

[GENERAL] Breakpoints are not triggered in analyze.c (debugging Postgresql in Visual studio)

2014-01-16 Thread Felix .
Hi all, I've set up a developing environment on my windows using Visual Studio 2012, everything works fine, except that the breakpoints set in analyze.c are not triggered in debug mode (breakpoints in main.c and some initialization code worked well), and I'm sure that line has been executed since

[GENERAL] What is the correct way to get the content of a varchar field in pgsql's source code

2014-01-20 Thread Felix .
Hi all, I've learnt from the source code to open a table and scan it, like this: Relation qma = try_relation_open(qmappersta, AccessShareLock); if(qma!=NULL){ HeapScanDesc scan= heap_beginscan(qma,SnapshotNow,0,NULL); HeapTuple tup; TupleDesc tupDesc= RelationGetDescr(qma); Datum

[GENERAL] How to convert a double value to a numeric datum type in pgsql?

2014-02-23 Thread Felix .
Hi all, I'm talking about the source code of pgsql and I want to know how the typing system works in pgsql. A few functions can help us do the type conversion, for example: Int32GetDatum -- convert a integer to a datum Float8GetDatum -- convert double to a datum cstring_to_text -- convert a