[GENERAL] cannot compile www_fdw Foreign Data Wrapper

2012-05-17 Thread Adrian Schreyer
Hi all, I am trying to compile the www_fdw foreign data wrapper on PostgreSQL 9.2 beta but I am getting the following error: cp sql/www_fdw.sql sql/www_fdw--0.1.0.sql gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -DLINUX_OOM_ADJ=0

[GENERAL] Query planner always has exactly half of the rows in the table as "plan rows" with new GIST operator class

2011-10-31 Thread Adrian Schreyer
I have added a GIST operator class to a custom data type in PostgreSQL. The index returns the correct results and the build speed is fairly good as well. There is one problem however that is presumably linked to the picksplit function (?) - the query planner always returns half of all the rows in

Re: [GENERAL] Custom data type in C with one fixed and one variable attribute

2011-10-28 Thread Adrian Schreyer
I added one more byte to include \0 and its working as expected now. Thanks for your help! Cheers, Adrian On Thu, Oct 27, 2011 at 23:23, Tom Lane wrote: > Adrian Schreyer writes: >> The data type I have is > >> typedef struct { >>         int4   length; >>      

[GENERAL] Custom data type in C with one fixed and one variable attribute

2011-10-27 Thread Adrian Schreyer
Hi, I am trying to create a custom data type in C that has a fixed size and a variable size attribute - is that actually possible? The documentation mentions only one or the other but a struct in the pg_trgm extension (TRGM) seems to have that. The data type I have is typedef struct { in

[GENERAL] Latency problems with simple queries

2011-07-07 Thread Adrian Schreyer
I randomly get latency/performance problems even with very simple queries, for example fetching a row by primary key from a small table. Since I could not trace it back to specific queries, I decided to give LatencyTOP (http://www.latencytop.org/) a go. Soon after running a couple of queries, I saw

[GENERAL] Dumping schemas using pg_dump without extensions (9.1 Beta)

2011-05-24 Thread Adrian Schreyer
I am trying to backup a single schema only, without any other database objects such as extensions. pg_dump however always includes extensions, even with the --schema=schema option specified (see below for example). Is there a workaround for this? Cheers, Adrian -- -- TOC entry 20 (class 3079 OID

Re: [GENERAL] Best way to construct PostgreSQL ArrayType (_int4) from C int array

2011-04-27 Thread Adrian Schreyer
On Wed, Apr 27, 2011 at 18:06, Merlin Moncure wrote: > On Wed, Apr 27, 2011 at 12:00 PM, Adrian Schreyer wrote: >> The largest arrays I expect at the moment are more or less sparse >> vectors of around 4.8k elements and I have noticed that the >> input/output (C/C++ exte

Re: [GENERAL] Best way to construct PostgreSQL ArrayType (_int4) from C int array

2011-04-27 Thread Adrian Schreyer
Wed, Apr 27, 2011 at 6:02 AM, Adrian Schreyer wrote: >> At the moment I am using the following code to construct a PostgreSQL >> array from a C array in my C extension but I am not so sure if this is >> really the best solution: >> >> const int *data = array.data(); //

[GENERAL] Best way to construct PostgreSQL ArrayType (_int4) from C int array

2011-04-27 Thread Adrian Schreyer
At the moment I am using the following code to construct a PostgreSQL array from a C array in my C extension but I am not so sure if this is really the best solution: const int *data = array.data(); // C array Datum *d = (Datum *) palloc(sizeof(Datum) * size); for (int i = 0; i < size; i++) d[i]

Re: [GENERAL] Weird problems with C extension and bytea as input type

2011-03-23 Thread Adrian Schreyer
On Wed, Mar 23, 2011 at 14:08, Merlin Moncure wrote: > On Wed, Mar 23, 2011 at 9:04 AM, dennis jenkins > wrote: >> On Wed, Mar 23, 2011 at 5:08 AM, Adrian Schreyer wrote: >>> >>> you are right, it returns a char *. >>> >>> The prototype: >&g

Re: [GENERAL] Weird problems with C extension and bytea as input type

2011-03-23 Thread Adrian Schreyer
On Wed, Mar 23, 2011 at 14:08, Merlin Moncure wrote: > On Wed, Mar 23, 2011 at 9:04 AM, dennis jenkins > wrote: >> On Wed, Mar 23, 2011 at 5:08 AM, Adrian Schreyer wrote: >>> >>> you are right, it returns a char *. >>> >>> The prototype: >&g

Re: [GENERAL] Weird problems with C extension and bytea as input type

2011-03-23 Thread Adrian Schreyer
On Tue, Mar 22, 2011 at 22:21, David W Noon wrote: > On Tue, 22 Mar 2011 16:14:47 -0500, Merlin Moncure wrote about Re: > [GENERAL] Weird problems with C extension and bytea as input type: > > [snip] >>>> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer >>>

Re: [GENERAL] Weird problems with C extension and bytea as input type

2011-03-23 Thread Adrian Schreyer
On Tue, Mar 22, 2011 at 22:21, David W Noon wrote: > On Tue, 22 Mar 2011 16:14:47 -0500, Merlin Moncure wrote about Re: > [GENERAL] Weird problems with C extension and bytea as input type: > > [snip] >>>> On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer >>>

Re: [GENERAL] Weird problems with C extension and bytea as input type

2011-03-22 Thread Adrian Schreyer
On Tue, Mar 22, 2011 at 16:07, Merlin Moncure wrote: > On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer wrote: >> Hi, >> >> I have a weird problem with my custom functions (written in C,C++) >> that use bytea as input type (cstring works fine). The functions will >

Re: [GENERAL] Weird problems with C extension and bytea as input type

2011-03-22 Thread Adrian Schreyer
On Tue, Mar 22, 2011 at 16:07, Merlin Moncure wrote: > On Tue, Mar 22, 2011 at 8:22 AM, Adrian Schreyer wrote: >> Hi, >> >> I have a weird problem with my custom functions (written in C,C++) >> that use bytea as input type (cstring works fine). The functions will >

[GENERAL] Weird problems with C extension and bytea as input type

2011-03-22 Thread Adrian Schreyer
Hi, I have a weird problem with my custom functions (written in C,C++) that use bytea as input type (cstring works fine). The functions will work as expected if they are the only function that uses the bytea column in a query; as soon as there is a second function using the same column, the C func