[GENERAL] Pl/pgsql function

2011-06-04 Thread Nick Raj
I am implementing some pl/pgsql functions. Is there any way to change the input for example- I got some value by $1. I want to modify this value (means split that value), Can we do this and how? Second thing, Suppose i defined a function test as select test('geom',the_geom,time) from tablename

[GENERAL] Index Size

2011-05-30 Thread Nick Raj
Hi, Cube code provided by postgres contrib folder. It uses the NDBOX structure. On creating index, it's size increase at a high rate. On inserting some tuple and creating indexes its behaviour is shown below. 1. When there is only one tuple select pg_size_pretty(pg_relation_

Re: [GENERAL] Index Size

2011-05-30 Thread Nick Raj
On Tue, May 31, 2011 at 8:50 AM, Tom Lane t...@sss.pgh.pa.us wrote: Craig Ringer cr...@postnewspapers.com.au writes: On 05/30/2011 08:53 PM, Nick Raj wrote: Cube code provided by postgres contrib folder. It uses the NDBOX structure. On creating index, it's size increase at a high rate

Re: [GENERAL] disable seqscan

2011-05-24 Thread Nick Raj
On Mon, May 23, 2011 at 7:35 PM, Tom Lane t...@sss.pgh.pa.us wrote: Nick Raj nickrajj...@gmail.com writes: Andrew Sullivan a...@crankycanuck.ca wrote: It sounds like your index can't actually be used to satisfy your query. Without seeing the table definition, index definition, and query

[GENERAL] disable seqscan

2011-05-23 Thread Nick Raj
Hi, I have build an index. When, i execute the query, it gives the result by sequential scan, not by using my index. I have already run vacuum analyze to collect some statistics regarding table. May be sequential scan is giving faster execution time than my indexing. But i want to know how much

Re: [GENERAL] disable seqscan

2011-05-23 Thread Nick Raj
On Mon, May 23, 2011 at 5:44 PM, Andreas Kretschmer akretsch...@spamfence.net wrote: Andrew Sullivan a...@crankycanuck.ca wrote: On Mon, May 23, 2011 at 05:31:04PM +0530, Nick Raj wrote: Hi, I have build an index. When, i execute the query, it gives the result by sequential scan

[GENERAL] Toast datum

2011-05-16 Thread Nick Raj
Hi, #define DatumGetNDBOX(x)((NDBOX*)DatumGetPointer(x)) #define PG_GETARG_NDBOX(x)DatumGetNDBOX( PG_DETOAST_DATUM(PG_GETARG_DATUM(x)) ) Now i have to define #define NDBOXGetDatum(x) ()PointerGetDatum(x) Is there any need to replace this ?? with some toastable thing or is it

[GENERAL] arguments are not toastable

2011-05-16 Thread Nick Raj
Hi, I have defined some function and also used NDBOX structure that having variable length. typedef struct NDBOX { int32vl_len_;/* varlena length */ unsigned int dim; doublex[1]; } NDBOX; When i called my function, it gives NDBOX to be null On debugging, i

Re: [GENERAL] Debug Contrib/cube code

2011-05-13 Thread Nick Raj
, 2011 at 6:42 AM, Joshua Tolley eggyk...@gmail.com wrote: On Fri, May 06, 2011 at 10:43:23AM +0530, Nick Raj wrote: Hi, I am using postgresql-8.4.6. I want to debug the contrib/cube code. Can we able to debug that cube code? Because there is no .configure file to enable debug

[GENERAL] Debug Contrib/cube code

2011-05-05 Thread Nick Raj
Hi, I am using postgresql-8.4.6. I want to debug the contrib/cube code. Can we able to debug that cube code? Because there is no .configure file to enable debug. Is there is any way to change make file to enable debug? Thanks Nick

[GENERAL] Defining input function for new datatype

2011-04-21 Thread Nick Raj
Hi, I am defining a new data type called mpoint i.e. typedef struct mpoint { Point p; Timestamp t; } mpoint; For defining input/output function 1 Datum mpoint_in(PG_FUNCTION_ARGS) 2 { 3 4mpoint *result; 5char *pnt=(char *)malloc (sizeof (20)); 6char

Re: [GENERAL] Typecast

2011-04-18 Thread Nick Raj
Thanks dude On Mon, Apr 18, 2011 at 2:25 PM, Chetan Suttraway chetan.suttra...@enterprisedb.com wrote: On Fri, Apr 15, 2011 at 10:29 PM, Nick Raj nickrajj...@gmail.com wrote: Hi, Can anybody tell me how to typecast data type Point into Datum? Thanks Nick Assuming you are referring

[GENERAL] Typecast

2011-04-15 Thread Nick Raj
Hi, Can anybody tell me how to typecast data type Point into Datum? Thanks Nick

[GENERAL] Global Variables in plpgsql

2011-04-11 Thread Nick Raj
Hi, Can anyone know how to define global variable in plpgsql? Thanks Regards, Raj

[GENERAL] Integrating New Data Type

2011-04-05 Thread Nick Raj
Hi all, I have defined a new data type. I have defined in and out function for that data type. But i want to know how to integrate this data type with postgres (how postgres compile my code or know my datatype) ? Thanks, Nirmesh

[GENERAL] Understanding Datum

2011-03-23 Thread Nick Raj
Hi, I am understanding the postgres code. In code, i just want to see what are values that are passing through the variables? Can you please tell me if the variable is of type Datum, then how to print its value? Because i dont the variable v type. And also what the structure of Datum? Thanks,

Re: [GENERAL] Understanding Datum

2011-03-23 Thread Nick Raj
?? How to find out what type of pointer argument is PG_GETARG_POINTER(1)?? Thanks, Nirmesh On Wed, Mar 23, 2011 at 11:40 PM, Radosław Smogura m...@smogura.eu wrote: Nick Raj nickrajj...@gmail.com Wednesday 23 March 2011 18:45:41 Hi, I am understanding the postgres code. In code, i just want

Re: [GENERAL] Understanding Datum

2011-03-23 Thread Nick Raj
in postgres? On Thu, Mar 24, 2011 at 2:35 AM, Tom Lane t...@sss.pgh.pa.us wrote: Nick Raj nickrajj...@gmail.com writes: In postgres, typedef uintptr_t Datum Datum is getting value from PG_GETARG_POINTER(1); But, now problem is how would i know the type of PG_GETARG_POINTER(1) (postgres

[GENERAL] Composite index structure

2011-03-06 Thread Nick Raj
Hi all, I want to construct an Composite Index Structure i.e. a combination of gist and btree. What i am thinking is that first creating a Rtree structure that is pointing to another Btree structure. For example, Suppose i want to find vehicles between 2 to 4 pm on 14/2/2011 on X road. I am

[GENERAL] data type

2011-03-02 Thread Nick Raj
Hi, I am writing some function in postgres pl/sql. My function is of type St_ABC((select obj_geom from XYZ),(select boundary_geom from boundary)) I have table XYZ with 20,000 tuples and in boundary, i have only one geometry. In postgres, ST_intersects(obj_geom, boundary_geom) checks each