[GENERAL] Memory error in user-defined aggregation function

2012-08-07 Thread Adriaan Joubert
Hi, I've implemented an aggregation function to compute quartiles in C borrowing liberally from orafce code. I uses this code in a windowing context and it worked fine until today - and I'm not sure what changed. This is on 9.1.2 and I have also tried it on 9.1.4. What I have determined so far (b

Re: [GENERAL] Memory error in user-defined aggregation function

2012-08-07 Thread Adriaan Joubert
- without orafce to guide me I would have had a hard time figuring any of this out from the docs. I'd gladly make the quartile implementation available for this purpose if there is interest. Adriaan On 7 August 2012 15:04, Adriaan Joubert wrote: > Hi, > > I've implemented an aggr

Re: [GENERAL] drop database failed

1998-11-09 Thread Adriaan Joubert
Fuad Abdallah wrote: I have just compiles postgres-6.4 under irix 6.5.1 with the SGI cc v7.2.1 > and everything seems to work fine - the regression test works with some > minor deviations - but i can not delete a database. > destroydb fails with the following error: > > ERROR: typeidTypeRelid:

[GENERAL] Postgres on Alpha?

1999-01-31 Thread Adriaan Joubert
Has anybody managed to get any of the postgres 6.4 versions to run correctly on Alpha? I have tried 6.4 through 6.4.2 and cannot get any of them to compile/run (I managed to get some versions to compile after some minor modifications, but then they did not run without crashing). I've tried both th

[GENERAL] Error in querying view

1999-02-18 Thread Adriaan Joubert
Hi I don't know whether this has been fixed in 6.4 -- I still cannot get 6.4 to compile and run on Alpha -- but I have the following error when querying a view in 6.3.2: I have a table with jobs/tasks (one job can consist of several tasks) that need to be executed, and have created a rel

[GENERAL] Use of index with oid's

1999-02-25 Thread Adriaan Joubert
As I cannot return a complete row of a record from a function (written in PL), I return an oid. So the function looks like this CREATE FUNCTION task_next (int4) RETURNS oid AS ' DECLARE ... END; ' LANGUAGE 'plpgsql'; This function can return null. I then select the next row with tt> select * fr

Re: [GENERAL] The WWW of PostgreSQL

1999-04-15 Thread Adriaan Joubert
The Hermit Hacker wrote: > > > > I don't want to create a polemic, but is it possible to make a > > recovery of the previous WWW interfaces of the postgreSQL.org site? > > What does an elephant do on the home page? Probably you have been > > hacked :-) > > The elephant surrounded by the diamond h

Re: [GENERAL] Trigger or Rule?

1999-04-26 Thread Adriaan Joubert
Andy Lewis wrote: > > I have a table that among other things has a name, address, city, state > fields. When I insert into, I want to be able to make sure that there is > no duplicate records or that a row is inserted that is already in the DB. > > Question number one is: Should I use a trigger

Re: [GENERAL] Trigger or Rule?

1999-04-26 Thread Adriaan Joubert
> > select count(*) into cnt from where new. = key; > if (cnt>0) then > delete from where key = new. > end if > Just looked at this, and this is not actually what you wanted. If you do not want to replace the old row, do something along the lines RAISE EXCEPTION ''Duplicate entry''

Re: [GENERAL] advice on buying sun hardware to run postgres

1999-04-26 Thread Adriaan Joubert
Jim Jennis wrote: > A DEC (sorry Compaq) Alpha running Linux is a mean combination. Used > Alpha's can be had fairly cheap and they really scream. If cost is an > issue, I would look for an older one used e.g. a > > DEC 2100/A500MP (was marketed as a "Sable") > > Put Linux on the beast and watch

Re: [GENERAL] Desperately Seeking Regular Expression

1999-04-27 Thread Adriaan Joubert
I solved something like this recently in perl. It's not terribly efficient, but it is simple. I'm doing this from memory, so it may need some debugging. Use something along the lines of #!/usr/local/bin/perl while (<>) { @a = split /(\")/; # This gives you a list with some of the items being

[GENERAL] Timing queries

1999-04-29 Thread Adriaan Joubert
Hi, I've got a large application with hundreds of different queries. I thought I had them all sorted out (i.e. determined the correct indices to make them quick), but now I see that, with 5 copies of the application running, I'm getting some serious contention on the database. Is there so

[GENERAL] psql/backend error messages

1999-05-06 Thread Adriaan Joubert
I'm seeing this in psql. I think this is bad. What could cause this? It is a join between three largish tables. I get loads of these. Backend sent B message without prior T Backend sent B message without prior T Backend sent D message without prior T Backend sent B message without prior T Backe

[GENERAL] Parser or documentation bug?

1999-06-03 Thread Adriaan Joubert
Hi, I'm trying to define a new bit type with a length of two bytes, and to define a set of operators on this type. I've hit the following problem: I cannot define a | operator, as the parser doesn't like it. tt=> drop operator | (Bit2,Bit2); ERROR: parser: parse error at or near "|" tt=

[GENERAL] PL Problems.

1999-06-03 Thread Adriaan Joubert
I have my marvelous bit type working now, and now I find out I cannot use it in PL scripts. tt=> create table test (a int4, b bit2); CREATE tt=> CREATE FUNCTION mytrig () RETURNS opaque AS ' tt-> ' tt'> DECLARE tt'> def_state CONSTANT BIT2 := 'b0001'::BIT2; tt'> BEGIN tt'> new.b = def_state;

Re: [GENERAL] PL Problems.

1999-06-03 Thread Adriaan Joubert
> tt=> create table test (a int4, b bit2); > CREATE > tt=> CREATE FUNCTION mytrig () RETURNS opaque AS > ' > tt-> ' > tt'> DECLARE > tt'> def_state CONSTANT BIT2 := 'b0001'::BIT2; > tt'> BEGIN > tt'> new.b = def_state; > tt'> RETURN new; > tt'> END; > tt'> ' LANGUAGE 'plpgsql'; > ERROR: pa

[GENERAL] User-defined types and indices

1999-06-09 Thread Adriaan Joubert
Hi, I defined a new type, and it is essential that I am able to use it in an index. This seems to require a bit more than just having the comparison operators. On the create index page it seems that it is necessary to define an *_ops class for the new type, but I have no idea how I go abo

Re: [GENERAL] User-defined types and indices

1999-06-09 Thread Adriaan Joubert
> > I defined a new type, and it is essential that I am able to use it in > an index. This seems to require a bit more than just having the > comparison operators. On the create index page it seems that it is > necessary to define an *_ops class for the new type, but I have no idea > how

[GENERAL] new type: 1-byte bit mask type

1999-06-10 Thread Adriaan Joubert
Hi, I finally finished my 1-byte bitmask type. You can even use it in btree indexes now. It provides all the standard bit operations (& | ^ ~ << >>) and I hope someone will find it useful. If anybody has any suggestions for improvements or questions, please let me know. If it passes muste

Re: [GENERAL] Perl - Apache / Postgress

1999-07-14 Thread Adriaan Joubert
> Erik Colson wrote: > > I'm using Apache with mod_perl to access a PostgresSQL database (6.5) > . > > The script starts with connecting to the database... this means that > the server is actually reconnecting everytime the script starts and > disconnect when the HTML page is generated. > > I'v

Re: [GENERAL] alpha and true64 port

1999-10-01 Thread Adriaan Joubert
Bruce Momjian wrote: > > hi, this is kind of emergent! > > > > we are in the process of decision making. Is there an true64 on > > alpha port? > > > > thanks in advance!! > > We have alpha/osf, but no tru64 that I know of. Tru64 is just a renaming of Digital Unix / OSF/1(Those Compaq people

Re: [GENERAL] Except operation

1999-12-01 Thread Adriaan Joubert
Satyajeet Seth wrote: > > Hi > The query: > select * from webdata except select * from webdata1; > takes abysmally long .How can I optimise it? > The particulars are: You could try select * from webdata w where not exists (select * from webdata1 w1 where w1.tid=w.tid

Re: [GENERAL] ALTER FUNCTION

1999-12-02 Thread Adriaan Joubert
Just drop the function, drop all triggers that use the function, re-create the function and recreate all triggers. If the function is called by other PL functions, you need to drop and re-install those as well. If you keep them all in a big file, every one preceded by drop, you can just reload th

Re: [GENERAL] get the previous assigned sequence value

1999-12-09 Thread Adriaan Joubert
> > With this second method, you'd probably need to beware race conditions. If > > another process inserts a record into mytable after you do but before you > > call currval(), then you'll get the wrong value. > > > > Not an issue if you've only got one process accessing the table - probably > > i

Re: [GENERAL] Future of PostgreSQL

1999-12-27 Thread Adriaan Joubert
john huttley wrote: > > I believe we are adding Oracle compatibility as possible. We are > > working on write-ahead log, long tuples, foreign keys, and outer joins. > > Anything else? > > Yes, earlier in the year I was trying to migrate from Pervasive SQL to > posgtres and > came to a screaming

Re: [GENERAL] Future of PostgreSQL

1999-12-27 Thread Adriaan Joubert
Hi, Yes, I think reliability needs more work. I've had quite a few problems with system indexes getting corrupted (number of tuples incorrect and some other bizarre problems). Very hard to pin down as I haven't been able to reproduce any of these cases. I've got the feeling that there may be

Re: [GENERAL] please help me recover from duplicate key in unique index

2000-01-04 Thread Adriaan Joubert
> > Please help me recover our database from what I think > > is a duplicate key in unique index problem. > > This may not help, and forgive my asking the obvious, but have > you done a SELECT on the table and actually *seen* duplicate 'id' > values in the SERIAL column? That would surprise me be

Re: [GENERAL] date expressions

2000-03-24 Thread Adriaan Joubert
surfer girl wrote: > I checked the manual on this but couldn't find a clear answer: > > I've got two dates in a database, a start date and and end date, which are type >"date." I want to compare these dates to today's date in the SQL statement, something >along the lines of "startdate < date <

Re: [GENERAL] And to make things even better...

2000-04-19 Thread Adriaan Joubert
Steve Wolfe wrote: > /var/lib/pgsql reports that we're running 6.3 - which I don't find on the > FTP site. Is that not a valid distribution number, or is the source not > available? Oh, I remember running 6.3. That was a looong time ago. Current version is 6.5.3 and 7.0 is about to be release

Re: [GENERAL] What are your using it for?

2000-04-19 Thread Adriaan Joubert
od and improving all the time. Show me another system where you can either fix bugs yourself or get a fix off the mailing list in a few hours! Adriaan   --  --+-------  Dr Adriaan Joubert   | Phone:  +357-2-750 652   APL Fi