[HACKERS] Perl 5.8 requirement for compiling on windows?

2011-07-04 Thread Marios Vodas
Hello, I want to ask why is there a requirement for 5.8 version of Perl to compile under windows? In this page of the documentation http://www.postgresql.org/docs/9.0/static/install-windows-full.html#AEN23848it sais: Note: version 5.8 is required. I was able to compile PostgreSQL 9.0.4 using

Re: [HACKERS] Perl 5.8 requirement for compiling on windows?

2011-07-04 Thread Marios Vodas
Yes, or at least change it by adding or later. It is confusing without it... Thank you for your response. On 4/7/2011 7:33 μμ, Heikki Linnakangas wrote: On 04.07.2011 19:30, Marios Vodas wrote: Hello, I want to ask why is there a requirement for 5.8 version of Perl to compile under windows

[HACKERS] GIST_LEAF() causes error in GiST methods union and penalty

2013-02-26 Thread Marios Vodas
to me because I have to handle different leaf/non-leaf data types. And one last question, the two parameters of the same method are always of the non-leaf data type? Kind regards,Marios Vodas

[HACKERS] C function to return tuple

2010-09-26 Thread Marios Vodas
I have these types: CREATE TYPE p_type AS ( x double precision, y double precision ); CREATE TYPE d_type AS ( i p_type, e p_type, id integer ); CREATE OR REPLACE FUNCTION d_swap(d_type) RETURNS d_type AS '/home/user/PostgreSQL/9.0/lib/mylib','d_swap' LANGUAGE C STRICT; My problem is that I

Re: [HACKERS] C function to return tuple

2010-09-26 Thread Marios Vodas
: Marios Vodas mvo...@gmail.com writes: My problem is that I don't know how to construct the d_type tuple in the c function. Seems like the main problem with that function is that you're passing an uninitialized nulls array to heap_form_tuple. I kinda wonder why you are using a fixed-length

Re: [HACKERS] C function to return tuple

2010-09-26 Thread Marios Vodas
the tuple? My problem here is that I DON'T have HeapTupleHeaders i and e already formed (those two are of p_type) so I have to form them somehow. On Sun, Sep 26, 2010 at 7:52 PM, Tom Lane t...@sss.pgh.pa.us wrote: Marios Vodas mvo...@gmail.com writes: //I need to get this working *values

Re: [HACKERS] C function to return tuple

2010-09-26 Thread Marios Vodas
...* On Sun, Sep 26, 2010 at 8:29 PM, Marios Vodas mvo...@gmail.com wrote: Suppose I had the data that form the returning tuple in 5 variables like this: float8 xi = 1; float8 yi = 2; float8 xe = 3; float8 ye = 4; int32 id = 1; In addition the function wouldn't have any input parameters

[HACKERS] forming tuple as an attribute inside another tuple in c function

2010-09-26 Thread Marios Vodas
Is it posible? Either by using heap_form_tuple or BuildTupleFromCStrings. CREATE TYPE p_type AS ( x double precision, y double precision ); CREATE TYPE d_type AS ( i p_type, e p_type, id integer ); CREATE OR REPLACE FUNCTION demo() RETURNS d_type AS

Re: [HACKERS] forming tuple as an attribute inside another tuple in c function

2010-09-27 Thread Marios Vodas
OK but what is the recommended way to get TupleDesc for p_type? I am aware of RelationNameGetTupleDesc but I shouldn't use it since it is deprecated. However by using it the code would look something like this (I tested it and it works as expected): Datum demo(PG_FUNCTION_ARGS) { float8 xi =

[HACKERS] gist access methods parameter types

2010-09-27 Thread Marios Vodas
If I have this sql composite type: CREATE TYPE d_type AS ( i integer, e integer, id integer ); and this table: CREATE TABLE my_tab ( d_col d_type NOT NULL ) CREATE INDEX my_tab_d_col_gist ON my_tab USING gist (d_col); I am implementing consistent, union, compress, decompress,

Re: [HACKERS] gist access methods parameter types

2010-09-27 Thread Marios Vodas
Let me explain better what I want to do. I want to have the types in sql level (composite types) like this: --Spatio-Temporal Position in 3 Dimensions(cartessian x, cartessian y, time) CREATE TYPE pos3d AS ( x double precision, y double precision, t timestamp ); --Spatio-Temporal Delta

Re: [HACKERS] gist access methods parameter types

2010-09-27 Thread Marios Vodas
Have you looked at PostGIS? Yes ofcourse, I also read everything in postgresql official documentation plus http://gist.cs.berkeley.edu/pggist/opcltour.html. Yeah, I still don't think that's the right way to do it. Storing the bounding box seems right, but just do that for all the nodes.

Re: [HACKERS] gist access methods parameter types

2010-09-27 Thread Marios Vodas
Please can you answer the question of whether entry-key in compress should be of delta3d sql type (composite type) and if not of what it should be since the type I index is different from the type stored in tree? Taking into consideration the types I described before this is my code for compress.

[HACKERS] timestamp_in DirectFunctionCall

2010-10-01 Thread Marios Vodas
Would this be correct? DatumGetTimestamp(DirectFunctionCall3(timestamp_in, CStringGetDatum(time), PointerGetDatum(0), Int32GetDatum(MAX_TIMESTAMP_PRECISION))); This is how timestamp_in starts, *#ifdef NOT_USED* is a litle bit confusing. Datum timestamp_in(PG_FUNCTION_ARGS) { char *str =

[HACKERS] gist picksplit iteration

2010-10-05 Thread Marios Vodas
At this page in documentation http://www.postgresql.org/docs/9.0/static/gist-implementation.html and under picksplit the loop that iterates through entryvec-vector[] starts from 1 (since FirstOffsetNumber equals 1). for (i = FirstOffsetNumber; i = maxoff; i = OffsetNumberNext(i)) I would expect

[HACKERS] compiling C library under mingw

2010-10-08 Thread Marios Vodas
I have a library that compiles fine under linux. But when I try to compile it under mingw on windows 7 I get the following errors. gcc.exe -c -O2 -I/C/PostgreSQL/9.0/include/server -I/C/PostgreSQL/9.0/include/server/utils -I/C/PostgreSQL/9.0/include/server/access

Re: [HACKERS] compiling C library under mingw

2010-10-09 Thread Marios Vodas
/PostgreSQL/9.0/lib -lpostgres -lpq, but it didn't work). All those references are declared as extern in postgres source code. Does anyone know what the library is? On Fri, Oct 8, 2010 at 12:27 PM, Marios Vodas mvo...@gmail.com wrote: I have a library that compiles fine under linux. But when I try

Re: [HACKERS] compiling C library under mingw

2010-10-09 Thread Marios Vodas
...@hagander.netwrote: You need to link to postgres.exe - either directly or by manually creating an import library. //Magnus On Sat, Oct 9, 2010 at 11:40, Marios Vodas mvo...@gmail.com wrote: I did a little search and I found that probably there is a library (dll or lib ???) that contains

[HACKERS] $libdir under linux

2010-10-10 Thread Marios Vodas
I want to create this function: CREATE OR REPLACE FUNCTION myfunction(cstring) RETURNS cstring AS '$libdir/mylib','myfunction' LANGUAGE 'C' IMMUTABLE STRICT; In windows this is working fine and $libdir is substituted by the actual path. In linux it is not substituted! This is the error I get:

[HACKERS] knngist plans

2010-10-14 Thread Marios Vodas
I would like to ask in which future version of postgresql knngist is planned to be included. Is there any possibility to be included in 9.1?

Re: [HACKERS] knngist plans

2010-10-15 Thread Marios Vodas
Recently I worked a lot with gist and read about knngist. I have spotted weaknesses in docs. So I would be happy to help if you tell me how. On Fri, Oct 15, 2010 at 5:57 AM, Robert Haas robertmh...@gmail.com wrote: On Wed, Oct 13, 2010 at 7:07 PM, Marios Vodas mvo...@gmail.com wrote: I would

Re: [HACKERS] knngist plans

2010-10-16 Thread Marios Vodas
Teodor has done. I could also prepare a document with the additions I would like to see in docs. Shall I do it? Of course it might take a while to finish it. On Fri, Oct 15, 2010 at 2:37 PM, Oleg Bartunov o...@sai.msu.su wrote: On Fri, 15 Oct 2010, Marios Vodas wrote: Recently I worked a lot

Re: [HACKERS] knngist plans

2010-10-19 Thread Marios Vodas
On Sat, Oct 16, 2010 at 8:42 PM, Oleg Bartunov o...@sai.msu.su wrote: Marios, you're right. There are several reasons for poor documentation, but of course, no excuse, we do need good docs any way ! It's very nice you're willing to write one, since it's always better seen from outside of

[HACKERS] gist DatumGetPointer returns pointer to corrupted data

2010-10-19 Thread Marios Vodas
I index these structures in gist: typedef struct { uint8 type_flag; float8 xi; float8 yi; Timestamp ti; float8 xe; float8 ye; Timestamp te; int32 id; } typ_s_flagged; typedef struct { uint8 type_flag; float8 xl; float8 yl; Timestamp

Re: [HACKERS] gist DatumGetPointer returns pointer to corrupted data

2010-10-19 Thread Marios Vodas
On Tue, Oct 19, 2010 at 10:23 PM, Robert Haas robertmh...@gmail.com wrote: Is pg_type.typlen set correctly? Are you refering to table pg_type? If yes, those type structures exist only in c I didn't write any in-out functions, so they don't exist in sql level. I pass a different data type

Re: [HACKERS] gist DatumGetPointer returns pointer to corrupted data

2010-10-22 Thread Marios Vodas
2010/10/22 Teodor Sigaev teo...@sigaev.ru Type should have in/out function, at least dummy. If type is not present in pg_type table then postgres can not operate with even on disk. Yes, you are right. I did some tests and I found that in order for it to work correctly the type we specify in

[HACKERS] Temporary tables and in-memory use

2011-09-29 Thread Marios Vodas
Hello, If I'm not wrong, temporary tables stay in memory if they do not go over temp_buffers limit (e.g. if temp_buffers is 2GB and the size of the table is 300MB the table will remain in memory). What if a column is variable length (e.g. text), how does this column stay in-memory since it should

Re: [HACKERS] Temporary tables and in-memory use

2011-09-29 Thread Marios Vodas
Thank you. The setup is intended for one user environment for complex queries and operations that's why I wrote 2GB temp_buffers! Thank you again, I really appreciate it. Marios On 29/9/2011 7:55 μμ, Tom Lane wrote: Marios Vodasmvo...@gmail.com writes: If I'm not wrong, temporary tables stay

[HACKERS] Problem with composite type creation in C under Linux

2011-03-02 Thread Marios Vodas
I have developed some custom composite and base types in PostgreSQL 9 which you can find in the code I provide below. I compile my C library using GCC 4.5 under Linux and Visual Studio 2010 under Windows. The problem is when I run this command: *SELECT to_composite('((1, 2), (3,

Re: [HACKERS] Problem with composite type creation in C under Linux

2011-03-02 Thread Marios Vodas
Thank you! now I understand it... On Wed, Mar 2, 2011 at 7:35 PM, Tom Lane t...@sss.pgh.pa.us wrote: Marios Vodas mvo...@gmail.com writes: I have developed some custom composite and base types in PostgreSQL 9 which you can find in the code I provide below. I compile my C library using

[HACKERS] Why pfree(NULL) breaks execution?

2011-03-04 Thread Marios Vodas
C doesn't break on free(NULL) so why is pfree developed to break on NULL? Is there any way in PostgreSQL to overcome this so that it won't break, apart from checking if the pointer NULL?

[HACKERS] Compile plPython for Python 3.2

2011-05-22 Thread Marios Vodas
I am trying to build plPython for Python 3.2 64bit under Windows 7 with Microsoft Windows SDK v7.0 (all tools are 64bit). I downloaded Python from python.org I get this error: C:\Users\user\Desktop\postgresql-9.0.4\pgsql.sln (default target) (1) - (PLs\plpython target) -

[HACKERS] GiST, getting the record in table that the leaf entry points to

2014-02-10 Thread Marios Vodas
Hello, What I would like to do is to get the record in the table that a leaf GISTENTRY points to, if that is possible. I notice that GISTENTRY contains these members: Relation rel, Page page, and OffsetNumber offset, but are these referring to the table or the index? Thank you, Marios Vodas