Re: [HACKERS] Call for 7.5 feature completion

2005-09-05 Thread Christopher Kings-Lynne

Oh, I remembered another of my personal feature requests for 8.2 :D

* Fix planning and execution of set operations so that they're not 
tragically slow. eg. rewriting into outer joins, etc.


Chris


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[HACKERS] Postgres optimizer, repeated function calls

2005-09-05 Thread Sergey E. Koposov
Hello, 

I have the following question about the Postgres optimizer.

I have two functions: 

CREATE OR REPLACE FUNCTION test_func(float, OUT a bigint, OUT b bigint) 
RETURNS record AS 'select test_func1($1)[1],test_func1($1)[2]
'LANGUAGE SQL IMMUTABLE;

and 

CREATE OR REPLACE FUNCTION test_func1 (float)
RETURNS bigint[] AS '/home/math/skyindex/q3cube/operators/libxx.so', 
'test_func1' LANGUAGE C IMMUTABLE;


And I was surprised to see that in such case, when I call the function
test_func, the function test_func1 is called twice. Why actually the
optimizer do so ? It should not be very difficult to optimize it to one call,
isn't it ? 


With Best Regards,
Sergey

PS I tested this example with including in C code of test_func1 the static
counter of calls. 

*
Sergey E. Koposov
Max-Planck Institut fuer Astronomie
Web: http://lnfm1.sai.msu.ru/~math 
E-mail: [EMAIL PROTECTED]


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] Call for 7.5 feature completion

2005-09-05 Thread Peter Eisentraut
Am Freitag, 26. August 2005 01:13 schrieb Alvaro Herrera:
 Or, slightly different, what are people's most wanted features?

For entertainment, here is a summary the most requested features:

1. MERGE command

2. Table partitioning

2. Materialized views

2. Updatable views

5. Index-organized tables, index-only access

6. Recursive queries

6. Window functions

8. Debuggable PL/pgSQL

8. Better bulk load

8. Multimaster replication

8. Database assertions

8. Multi-threaded/process query execution

8. CUBE and ROLLUP

8. Concurrent vacuum

So there is plenty of work left...

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


[HACKERS] inet increment with int

2005-09-05 Thread Patrick Welche
Ilya Kovalenko posted some code at in a thread starting at

  http://archives.postgresql.org/pgsql-hackers/2005-04/msg00417.php

which lead to the TODO item:

* Allow INET + INT4 to increment the host part of the address, or
  throw an error on overflow

I think that the naively coded function attached does what is needed, e.g.,

CREATE OR REPLACE FUNCTION inet_inc(inet, int4)
RETURNS inet
AS '/tmp/inet.so','inet_inc'
LANGUAGE C STRICT;

CREATE OPERATOR + (
leftarg = inet,
rightarg = int4,
procedure = inet_inc
);

test=# select '192.168.0.1/24'::inet + 300;
ERROR:  Increment (300) too big for network (/24)
test=# select '192.168.0.1/24'::inet + 254;
 ?column? 
--
 192.168.0.255/24
(1 row)

test=# select '192.168.0.1/24'::inet + 255;
ERROR:  Increment (255) takes address (192.168.0.1) out of its network (/24)
test=# select '192.168.0.1/24'::inet + -2;
ERROR:  Increment (-2) takes address (192.168.0.1) out of its network (/24)
test=# select '255.255.255.254/0'::inet + 2;
ERROR:  Increment (2) takes address (255.255.255.254) out of its network (/0)

and just for fun:

create table list (
host inet
);

insert into list values ('192.168.0.1/24');
insert into list values ('192.168.0.2/24');
insert into list values ('192.168.0.4/24');
insert into list values ('192.168.0.5/24');
insert into list values ('192.168.0.6/24');
insert into list values ('192.168.0.8/24');
insert into list values ('192.168.0.9/24');
insert into list values ('192.168.0.10/24');
insert into list values ('192.168.1.1/24');
insert into list values ('192.168.1.3/24');

select host+1 from list
 where host+1 = '192.168.1.0/24'
   and not exists
   ( select 1
   from list
  where host=host+1
and host  '192.168.1.0/24' )
 limit 1;



If you agree that this is the right thing, I can code it less
naively, (Ilya rightly uses ntohl/htonl), create the operator's
commutator, provide a patch which makes it a built-in, and some
obvious documentation.

Cheers,

Patrick
/* From the TODO:
 *Allow INET + INT4 to increment the host part of the address, or
 *throw an error on overflow
 */

#include postgres.h

#include sys/socket.h

#include fmgr.h
#include utils/inet.h

PG_FUNCTION_INFO_V1(inet_inc);

Datum
inet_inc(PG_FUNCTION_ARGS)
{
inet*in  = PG_GETARG_INET_P(0), *out;
int32inc = PG_GETARG_INT32(1);
inet_struct *src, *dst;
uint32   netmask, host, newhost;
int  i;

src = (inet_struct *)VARDATA(in);
if (src-family != PGSQL_AF_INET)
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
 errmsg(Function \inet_inc\ only supports AF_INET 
 
addresses)));

/* avoid int32 overflow when bits == 0 */
netmask = (src-bits == 0) ? 0 : (~((1  (32 - src-bits)) - 1));

/* if (inc doesn't fit in src-bits) overflow */
if ((abs(inc)  ~netmask) != abs(inc))
ereport(ERROR,
(errcode(ERRCODE_DATA_EXCEPTION),
 errmsg(Increment (%d) too big for network (/%d),
 inc, 
src-bits)));

/* can do this with htonl/ntohl */
host = 0;
for (i=0; i4; ++i)
host |= src-ipaddr[i]  (8 * (3-i));

newhost = host + inc;

if (((host  netmask) != (newhost  netmask))
|| (inc0  newhosthost)
|| (inc0  newhosthost))
ereport(ERROR,
(errcode(ERRCODE_DATA_EXCEPTION),
 errmsg(Increment (%d) takes address (%d.%d.%d.%d) out 
of its 
network (/%d), inc,
src-ipaddr[0], src-ipaddr[1], src-ipaddr[2],
src-ipaddr[3], src-bits)));

out = (inet *)palloc0(VARHDRSZ + sizeof(inet_struct));

dst = (inet_struct *)VARDATA(out);

dst-family = src-family;
dst-bits   = src-bits;
dst-type   = src-type;
for (i=0; i4; ++i)
dst-ipaddr[i] = (newhost  (8 * (3-i)))  0xff;
for (i=4; i16; ++i)
dst-ipaddr[i] = 0;

VARATT_SIZEP(out) = VARHDRSZ + sizeof(dst-family) + sizeof(dst-bits)
+ sizeof(dst-type) + 4;

PG_RETURN_INET_P(out);
}

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] Proof of concept COLLATE support with patch

2005-09-05 Thread Patrick Welche
On Mon, Sep 05, 2005 at 01:52:45AM +0200, Petr Jelinek wrote:
 Tom Lane wrote:
 
 The hole in that argument is the assumption that there *is* a freely
 available library that can be used (where freely == BSD license).
 We wouldn't be having this discussion if we knew of one.
 
 I see this discussion as another reason to use ICU, I mean complete 
 rewrite of locale handling to use ICU on all platforms. I know it's big 
 project but it's doable for 8.2 and it would virtually solve all locale 
 problems and could be base for new unicode/locale features. I am not 
 sure if this is the way postgres wants to go tho (having dependency on 
 such a big and uncommon library).

Maybe not so uncommon...

% ldd /usr/local/bin/php
/usr/local/bin/php:
...
-lresolv.1 = /usr/lib/libresolv.so.1
-lpq.4 = /usr/local/pgsql/lib/libpq.so.4
-lintl.0 = /usr/lib/libintl.so.0
-licudata.34 = /usr/local/lib/libicudata.so.34
-licuuc.34 = /usr/local/lib/libicuuc.so.34
-licui18n.34 = /usr/local/lib/libicui18n.so.34
-licuio.34 = /usr/local/lib/libicuio.so.34
...

Cheers,

Patrick

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [HACKERS] inet increment with int

2005-09-05 Thread Tom Lane
Patrick Welche [EMAIL PROTECTED] writes:
 * Allow INET + INT4 to increment the host part of the address, or
   throw an error on overflow

 I think that the naively coded function attached does what is needed, e.g.,

What happened to the IPv6 case?  Also, I think you need to reject CIDR
inputs.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[HACKERS] PostgreSQL configurable SSL key checking

2005-09-05 Thread Simon de Hartog
Hi,

I tried sending this mail to pgadmin, but nobody could find a solution
to my problem. So I changed my problem into a suggestion and I was
hoping I am at the right place for it here :-)

 Original Message 
Subject: Postgres using SSL connections
Date: Thu, 25 Aug 2005 20:27:18 +0200
From: Simon de Hartog [EMAIL PROTECTED]
To: pgsql-admin@postgresql.org

Hi,

I want to have Postgres use an SSL certificate for secure access by
clients over the internet. I have a server that runs PostgreSQL and I
have created my own Certificate Authority. I now have a certificate and
corresponding private key in /etc/ssl. This pair is used without
problems by:
- Apache 2
- LDAP server
- Sendmail
- stunnel
- VPN software

I have added all the users these applications run as to a group called
ssl. Permissions on the private key are owned by root, group ssl,
protection rw-r- (640). When I tell PostgreSQL to use this key with
certificate (by using symlinks from server.key and server.crt in the
postgreSQL data dir) it tells me that owner and permissions are wrong.

How can I use this certificate and key for PostgreSQL (without copying
the key and changing owner and permissions etc, because then the whole
idea of centrally coordinated certificates is gone)?

I checked the archives. A lot of comments considering the unclear error
messages in previous versions, this has been solved IMHO. Also some
comments and patches to remove these checks, concluded by comments that
they must remain. All in all, it still doesn't work for my situation.

So my suggestion is:

Would it be nice to have a configuration-file option to disable these
checks? Maybe possibly even configurable locations of these files,
instead of the defaults in the PostgreSQL data dir?

Kind regards and thanks in advance,

Simon de Hartog

P.S. If you would like a patch, do you want it against 8.0.x or 8.1 beta
(or both)?
-- 
From every point in life, there's a road that leads to where you
  want to go.

E: simon at-sign dehartog point nl
W: http://simon.dehartog.nl/
P: +31-6-15094709
M: simon_net at-sign rootsr point com
I: 8714776
K: http://www.rootsr.com/simon.crt

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] statement logging / extended query protocol issues

2005-09-05 Thread Simon Riggs
 Oliver Jowett wrote:
  8.1-beta1 produces some odd results with statement logging enabled when
  the extended query protocol is used (e.g. when using the JDBC driver).
  Repeatedly running a simple query with log_statement = 'all' produces this: 
... 

  Secondly, running a query that uses portals produces output like this:
  
  LOG:  statement: PREPARE S_3 AS SELECT * from pg_proc
  LOG:  statement: BIND C_4
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  LOG:  statement: EXECUTE C_4  [PREPARE:  SELECT * from pg_proc]
  
  Comments:
  - The BIND is still fairly content-free.
  - The EXECUTEs are a bit misleading as the SELECT was actually only run
  once (there are multiple Execute messages for the same portal). You
  could infer that there is only one SELECT from the repeated portal name
  and the lack of an intervening BIND, I suppose.

I've put together this prototype to offer more useful messages in the
situation Oliver describes.

Subsequent calls to the same portal are described as FETCHes rather than
as EXECUTEs. The portal name is still given and number of rows is
provided also.

I haven't tested this with the java program supplied, since this is a
fairly short-hack for comments. I'll correct any mistakes before
submission to patches.

Comments?

Best Regards, Simon Riggs
Index: src/backend/tcop/postgres.c
===
RCS file: /projects/cvsroot/pgsql/src/backend/tcop/postgres.c,v
retrieving revision 1.457
diff -c -c -r1.457 postgres.c
*** src/backend/tcop/postgres.c	11 Aug 2005 21:11:45 -	1.457
--- src/backend/tcop/postgres.c	5 Sep 2005 18:57:22 -
***
*** 1681,1686 
--- 1681,1687 
  	bool		save_log_duration = log_duration;
  	int			save_log_min_duration_statement = log_min_duration_statement;
  	bool		save_log_statement_stats = log_statement_stats;
+ boolsubsequent_fetch = false;
  
  	/* Adjust destination to tell printtup.c what to do */
  	dest = whereToSendOutput;
***
*** 1693,1698 
--- 1694,1707 
  (errcode(ERRCODE_UNDEFINED_CURSOR),
   errmsg(portal \%s\ does not exist, portal_name)));
  
+ /*
+  * If we re-issue an Execute protocol request against an existing
+  * portal, then we are only fetching more rows rather than 
+  * completely re-executing the query from the start
+  */
+ if (!portal-atEnd)
+ subsequent_fetch = true;
+ 
  	/*
  	 * If the original query was a null string, just return
  	 * EmptyQueryResponse.
***
*** 1704,1710 
  		return;
  	}
  
! 	if (portal-sourceText)
  	{
  		debug_query_string = portal-sourceText;
  		pgstat_report_activity(portal-sourceText);
--- 1713,1724 
  		return;
  	}
  
! if (subsequent_fetch)
! {
! 		debug_query_string = fetch message;
! 		pgstat_report_activity(FETCH);
! }
! else if (portal-sourceText)
  	{
  		debug_query_string = portal-sourceText;
  		pgstat_report_activity(portal-sourceText);
***
*** 1730,1739 
  		ResetUsage();
  
  	if (log_statement == LOGSTMT_ALL)
! 		/* We have the portal, so output the source query. */
! 		ereport(LOG,
  (errmsg(statement: EXECUTE %s  [PREPARE:  %s], portal_name,
  		portal-sourceText ? portal-sourceText : )));
  
  	BeginCommand(portal-commandTag, dest);
  
--- 1744,1760 
  		ResetUsage();
  
  	if (log_statement == LOGSTMT_ALL)
! {
! if (subsequent_fetch)
! 		ereport(LOG,
! (errmsg(statement: FETCH %s ROWS %ld, portal_name,
! max_rows)));
! else
! 		/* We have the portal, so output the source query. */
! 		ereport(LOG,
  (errmsg(statement: EXECUTE %s  [PREPARE:  %s], portal_name,
  		portal-sourceText ? portal-sourceText : )));
+ }
  
  	BeginCommand(portal-commandTag, dest);
  
***
*** 1862,1874 
  		if (save_log_min_duration_statement == 0 ||
  			(save_log_min_duration_statement  0 
  			 usecs = save_log_min_duration_statement * 1000))
! 			ereport(LOG,
  	(errmsg(duration: %ld.%03ld ms  statement: EXECUTE %s  [PREPARE:  %s],
  		(long) ((stop_t.tv_sec - start_t.tv_sec) * 1000 +
  			  (stop_t.tv_usec - start_t.tv_usec) / 1000),
  		(long) (stop_t.tv_usec - start_t.tv_usec) % 1000,
  			portal_name,
  			portal-sourceText ? portal-sourceText : )));
  	}
  
  	if (save_log_statement_stats)
--- 1883,1906 
  		if (save_log_min_duration_statement == 0 ||
  			(save_log_min_duration_statement  0 
  			 usecs = save_log_min_duration_statement * 1000))
! {
! if (subsequent_fetch)
! 		ereport(LOG,
! 	

Re: [HACKERS] inet increment with int

2005-09-05 Thread Patrick Welche
On Mon, Sep 05, 2005 at 03:02:55PM -0400, Tom Lane wrote:
 Patrick Welche [EMAIL PROTECTED] writes:
  * Allow INET + INT4 to increment the host part of the address, or
throw an error on overflow
 
  I think that the naively coded function attached does what is needed, e.g.,
 
 What happened to the IPv6 case?

My take on the thread is that the IPv6 case doesn't make sense, and the
int8 part was dropped from the TODO.

 Also, I think you need to reject CIDR inputs.

OK

Patrick

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] PostgreSQL configurable SSL key checking

2005-09-05 Thread Tom Lane
Simon de Hartog [EMAIL PROTECTED] writes:
 I have added all the users these applications run as to a group called
 ssl. Permissions on the private key are owned by root, group ssl,
 protection rw-r- (640). When I tell PostgreSQL to use this key with
 certificate (by using symlinks from server.key and server.crt in the
 postgreSQL data dir) it tells me that owner and permissions are wrong.

 How can I use this certificate and key for PostgreSQL (without copying
 the key and changing owner and permissions etc, because then the whole
 idea of centrally coordinated certificates is gone)?

You can't, and I don't see why it's a good idea to use the same key for
different server applications.

regards, tom lane

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [HACKERS] 4D Geometry

2005-09-05 Thread Tom Lane
Chris Traylor [EMAIL PROTECTED] writes:
 1.) Is anyone else currently working on this?

No, and AFAIR no one has ever even asked for it.  I'm a little dubious
about doubling the storage requirements for geometry data and likely
creating backwards-compatibility issues to implement a feature that only
you need.  I'd suggest keeping these as separate private types rather
than expecting that a patch to replace the 2D types will be accepted.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] PostgreSQL configurable SSL key checking

2005-09-05 Thread Alvaro Herrera
On Mon, Sep 05, 2005 at 09:03:06PM +0200, Simon de Hartog wrote:

 I have added all the users these applications run as to a group called
 ssl. Permissions on the private key are owned by root, group ssl,
 protection rw-r- (640). When I tell PostgreSQL to use this key with
 certificate (by using symlinks from server.key and server.crt in the
 postgreSQL data dir) it tells me that owner and permissions are wrong.
 
 How can I use this certificate and key for PostgreSQL (without copying
 the key and changing owner and permissions etc, because then the whole
 idea of centrally coordinated certificates is gone)?

Did you try using a hardlink instead of a symlink?

-- 
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
Ninguna manada de bestias tiene una voz tan horrible como la humana (Orual)

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] PostgreSQL configurable SSL key checking

2005-09-05 Thread Alvaro Herrera
On Mon, Sep 05, 2005 at 03:27:01PM -0400, Alvaro Herrera wrote:
 On Mon, Sep 05, 2005 at 09:03:06PM +0200, Simon de Hartog wrote:
 
  I have added all the users these applications run as to a group called
  ssl. Permissions on the private key are owned by root, group ssl,
  protection rw-r- (640). When I tell PostgreSQL to use this key with
  certificate (by using symlinks from server.key and server.crt in the
  postgreSQL data dir) it tells me that owner and permissions are wrong.
 
 Did you try using a hardlink instead of a symlink?

Huh, sorry, of course it doesn't work.

-- 
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
Syntax error: function hell() needs an argument.
Please choose what hell you want to involve.

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] statement logging / extended query protocol issues

2005-09-05 Thread Tom Lane
Simon Riggs [EMAIL PROTECTED] writes:
 + /*
 +  * If we re-issue an Execute protocol request against an existing
 +  * portal, then we are only fetching more rows rather than 
 +  * completely re-executing the query from the start
 +  */
 + if (!portal-atEnd)
 + subsequent_fetch = true;

That strikes me as a completely bogus test for a re-issued execute.
Did you mean !atStart?

Also, why is it a good idea to report the number of rows fetched in
some cases (and not others)?

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] PostgreSQL configurable SSL key checking

2005-09-05 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes:
 On Mon, Sep 05, 2005 at 09:03:06PM +0200, Simon de Hartog wrote:
 How can I use this certificate and key for PostgreSQL (without copying
 the key and changing owner and permissions etc, because then the whole
 idea of centrally coordinated certificates is gone)?

 Did you try using a hardlink instead of a symlink?

Won't help --- he's complaining about the stat() test on ownership and
permissions of the private key file (in be-secure.c).  stat looks
through symlinks, so the answer will be the same.

regards, tom lane

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] 4D Geometry

2005-09-05 Thread Chris Traylor




On Mon, 2005-09-05 at 15:27 -0400, Tom Lane wrote:


Chris Traylor [EMAIL PROTECTED] writes:
 1.) Is anyone else currently working on this?

No, and AFAIR no one has ever even asked for it.  I'm a little dubious
about doubling the storage requirements for geometry data and likely
creating backwards-compatibility issues to implement a feature that only
you need.  I'd suggest keeping these as separate private types rather
than expecting that a patch to replace the 2D types will be accepted.



What do you think about making it a configure option, i.e. --enable-4D-geometry (default false)? This way people who don't want/need the extra overhead don't have to deal with it, and those who want to use postgres for scientific/engineering/animation/etc apps (where 2D doesn't quite cut the mustard) can have it available to them. I was thinking that it would allow a whole new set of applications to take advantage of the fact that postgres provides native geometric types. After all, you can use just about any db engine to handle geometric data with traditional sql and stored procedures. The point of the builtins is so you have a standard set of algorithms, and that you don't have to constantly reinvent the wheel. Like I said in my earlier message, I can patch the source for myself, and go about my merry way. The geometry portions really don't seem to change very frequently (the differences between 8.0.3, and 8.1beta were minimal), and except for the line stuff, the changes were trivial, so personal maintenance shouldn't be a problem. I just thought I'd share my work.:-)




			regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

 http://archives.postgresql.org





Chris

--
Sometimes I wonder whether the world is being run by smart people who are putting us on or by imbeciles who really mean it. -- Mark Twain







[HACKERS] Install Darwin's locale library on your system :)

2005-09-05 Thread Martijn van Oosterhout
Well, it was pointed out the other day that the Darwin C library
supports the non-standard extensions to the POSIX locale interface and
that this might be ported to other systems so PostgreSQL could use it.

So, I have written a few scripts which download the libc and locale
library from darwinsource, shuffle some files around and build the
result into a library called libdummylocale.so. It basically completely
replaces your locale support on whatever system you use it on.

It's all under the APSL, though some parts may be BSD licenced.

Let me say right now, the locale support here sucks, no two ways about
it. It doesn't support a single UTF-8 locale. Oh, it lets you specify
them, but when you ask for the CHARSET it still says US-ASCII. It does
support a number of other different charsets. (Not for collation
though).

So my challenge to those people who think maintaining a locale library
is easy: make *one* locale in FreeBSD (or Darwin or this lib) support
full UTF-8 collation in whatever locale and/or charset you choose. It's
all downhill from there.

While it builds simple programs, I don't think it's totally safe. You'd
need to rename the headers at least. And building on Darwin will
probably blow up due to the way it plays fast and loose with Darwin
specific #defines. But it's a beginning if anyone is interested. It
builds in my glibc system.

I'm going to drop the idea of making a locale library, there's just
nothing good enough. glibc is the only thing that comes close. From here
on I'm going to work on COLLATE for systems that support xlocale, with
an eye on ICU if/when it becomes standard enough.

Download: http://svana.org/kleptog/pgsql/dummylocale.tar.gz

Have a nice day,
-- 
Martijn van Oosterhout   kleptog@svana.org   http://svana.org/kleptog/
 Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
 tool for doing 5% of the work and then sitting around waiting for someone
 else to do the other 95% so you can sue them.


pgp5fPUhr4aFM.pgp
Description: PGP signature


Re: [HACKERS] statement logging / extended query protocol issues

2005-09-05 Thread Oliver Jowett
Simon Riggs wrote:

 Subsequent calls to the same portal are described as FETCHes rather than
 as EXECUTEs. The portal name is still given and number of rows is
 provided also.

I wonder if it might be better to only log the first Execute.. It's not
immediately clear to me that it's useful to see all the individual
fetches when they're logically part of a single query.

-O

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[HACKERS] Attention PL authors: want to be listed in template table?

2005-09-05 Thread Tom Lane
I've committed changes to implement the cut-down form of this proposal:
http://archives.postgresql.org/pgsql-hackers/2005-08/msg01185.php
discussed here:
http://archives.postgresql.org/pgsql-hackers/2005-09/msg00138.php

Barring further changes, we'll have a hard-wired template list for 8.1
and a real system catalog in 8.2.  So there's a choice now for PLs that
are not part of the core distribution: do you want to be listed in the
hard-wired template?

The advantages of being listed are:

1. Reloading old dumps that involve your language should be easier,
since problems like version-specific paths to shared libraries will
go away.

2. Your PL support functions will end up in pg_catalog instead of
the public schema, which will please people who'd like to remove public
from their installations.

The main disadvantage I can see is that you won't easily be able to
change your PL creation parameters (eg, add a validator function)
over the lifespan of the 8.1 release.  So depending on your development
roadmap you might think this a bad tradeoff.

If you want to be listed, let me know.  What I need to know to list you
is values for this table:

typedef struct
{
char   *lanname; /* PL name */
boollantrusted;  /* trusted? */
char   *lanhandler;  /* name of handler function */
char   *lanvalidator;/* name of validator function, or NULL */
char   *lanlibrary;  /* path of shared library */
} PLTemplate;

As examples, the entries for the core PLs are

{ plpgsql, true, plpgsql_call_handler, plpgsql_validator,
  $libdir/plpgsql },
{ pltcl, true, pltcl_call_handler, NULL,
  $libdir/pltcl },
{ pltclu, false, pltclu_call_handler, NULL,
  $libdir/pltcl },
{ plperl, true, plperl_call_handler, plperl_validator,
  $libdir/plperl },
{ plperlu, false, plperl_call_handler, plperl_validator,
  $libdir/plperl },
{ plpythonu, false, plpython_call_handler, NULL,
  $libdir/plpython },


regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


[HACKERS] release schedule

2005-09-05 Thread Bruce Momjian
Beta1 has gone very well so far.  There have been very few bug reports,
though I know that many people are testing it because it is mentioned on
our home page.  I know Tom is working on a patch for procedural
languages, but other than that, there are not many other open issues. 
Perhaps we should start thinking about Beta2.  

Also, I am heading to Sri Lanka now.  I will be off line for 36 hours. 
I should have internet access in the hotel.  I will return on Wed. Sep.
14th.  
-- 
  Bruce Momjian|  http://candle.pha.pa.us
  pgman@candle.pha.pa.us   |  (610) 359-1001
  +  If your life is a hard drive, |  13 Roberts Road
  +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [HACKERS] 4D Geometry

2005-09-05 Thread Tom Lane
Chris Traylor [EMAIL PROTECTED] writes:
 On Mon, 2005-09-05 at 15:27 -0400, Tom Lane wrote:
 I'd suggest keeping these as separate private types rather
 than expecting that a patch to replace the 2D types will be accepted.

 What do you think about making it a configure option, i.e.
 --enable-4D-geometry (default false)?

Configure options are generally a pain in the neck, particularly if they
cause significant changes in user-visible behavior.  What's wrong with
creating separate types instead of changing the behavior of the existing
ones?

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] release schedule

2005-09-05 Thread Tom Lane
Bruce Momjian pgman@candle.pha.pa.us writes:
 Perhaps we should start thinking about Beta2.  

There are some open items with roles and triggers that would be nice
to fix first, but I agree beta2 should be soon.  End of the week or so,
maybe?

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [HACKERS] 4D Geometry

2005-09-05 Thread Chris Traylor




On Mon, 2005-09-05 at 20:40 -0400, Tom Lane wrote:


Chris Traylor [EMAIL PROTECTED] writes:
 On Mon, 2005-09-05 at 15:27 -0400, Tom Lane wrote:
 I'd suggest keeping these as separate private types rather
 than expecting that a patch to replace the 2D types will be accepted.

 What do you think about making it a configure option, i.e.
 --enable-4D-geometry (default false)?

Configure options are generally a pain in the neck,


Granted. Especially, if all the ifdefs start making the source hard to read, but they are a viable compile-time way to allow the user to make the decision for themselves.



 particularly if they
cause significant changes in user-visible behavior.
 What's wrong with
creating separate types instead of changing the behavior of the existing
ones?


I'd really rather not write a mirror version of every geometric function, in order to use a private type.




			regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend





Chris

--
Sometimes I wonder whether the world is being run by smart people who are putting us on or by imbeciles who really mean it. -- Mark Twain







Re: [HACKERS] release schedule

2005-09-05 Thread Marc G. Fournier


You usually post a list of Open Items during Beta ... other then that, end 
of the week sounds cool to me ...


On Mon, 5 Sep 2005, Bruce Momjian wrote:


Beta1 has gone very well so far.  There have been very few bug reports,
though I know that many people are testing it because it is mentioned on
our home page.  I know Tom is working on a patch for procedural
languages, but other than that, there are not many other open issues.
Perhaps we should start thinking about Beta2.

Also, I am heading to Sri Lanka now.  I will be off line for 36 hours.
I should have internet access in the hotel.  I will return on Wed. Sep.
14th.
--
 Bruce Momjian|  http://candle.pha.pa.us
 pgman@candle.pha.pa.us   |  (610) 359-1001
 +  If your life is a hard drive, |  13 Roberts Road
 +  Christ can be your backup.|  Newtown Square, Pennsylvania 19073

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings






Marc G. Fournier   Hub.Org Networking Services (http://www.hub.org)
Email: [EMAIL PROTECTED]   Yahoo!: yscrappy  ICQ: 7615664

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [HACKERS] Call for 7.5 feature completion

2005-09-05 Thread William ZHANG
Merlin Moncure [EMAIL PROTECTED] wrote
And I think VC++ 6.0 is ok, it is power enough and not so big for
  pgsql's
   development. And latter versions of VC++ can automatically convert
  6.0's
   project files. There are also a VC++7 to VC++6 project converter
 on
   www.codeproject.com.
 
  | You might be surprised to know that this has been already done.
 Back in
  | the 7.2 cycle there was a win32 build floating around that compiled
 and
  | built inside of visual studio 6.  I think Jan Wieck was one of the
  | people involved in the effort.
 
  | That would be a good place to start looking.
 
  | Merlin
 
  I know sth. about Jan Wieck's work, but cannot find the VC++
 projects.
  Now I have started a PgFoundry project vcproject.
 
  Regards,
  William ZHANG

 The peerdirect port is still available on Bruce's ftp site here:
 ftp://momjian.postgresql.org/pub/postgresql/win32/PeerDirect/

 as a patch vs. the 7.2 postgresql.


 fwiw, I think your project is in a race against time vs. the upcoming
 improved win32 posix support.  Details are skimpy but the rumors are ms
 is going to allow running just about any unix app without emulation.

I remember that Microsoft stopped supporting POSIX subsystem in Win32.
Can you give me more information?

 Currently the major advantage I see of providing alternative to mingw is
 providing 64 bit version of postgresql to windows since mingw does not
 appear to be going 64 bit anytime soon.

Not thinking about that yet.

 The win32 build environment issue was discussed quite heatedly when the
 porting effort started heating up.  At the time I advocated for a vc6
 build environment but have since then realized that probably would have
 been a mistake.

 Merlin

 ---(end of broadcast)---
 TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match




---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [HACKERS] release schedule

2005-09-05 Thread Alvaro Herrera
On Tue, Sep 06, 2005 at 12:23:59AM -0300, Marc G. Fournier wrote:
 
 You usually post a list of Open Items during Beta ... other then that, end 
 of the week sounds cool to me ...

One important item on that list is add documentation for autovacuum.
I'll try to come up with something before beta2.

-- 
Alvaro Herrera -- Valdivia, Chile Architect, www.EnterpriseDB.com
Y una voz del caos me habló y me dijo
Sonríe y sé feliz, podría ser peor.
Y sonreí. Y fui feliz.
Y fue peor.

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [HACKERS] Attention PL authors: want to be listed in template

2005-09-05 Thread Joe Conway

Tom Lane wrote:

If you want to be listed, let me know.  What I need to know to list you
is values for this table:

typedef struct
{
char   *lanname; /* PL name */
boollantrusted;  /* trusted? */
char   *lanhandler;  /* name of handler function */
char   *lanvalidator;/* name of validator function, or NULL */
char   *lanlibrary;  /* path of shared library */
} PLTemplate;



Hi Tom,

Please include PL/R:

 { plr, false, plr_call_handler, NULL, $libdir/plr },

Thanks,

Joe

p.s. my (supposedly) static IP changed this summer -- I think my direct 
mail might be getting blocked by your spam filters again.


---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


[HACKERS] How to add column in pg_class

2005-09-05 Thread Rafaqat Ali
 

Hello  can any one tell me how can I add a new cloumn in pg_class
Currently I am doing :   In pg_class.h	* In CATALOG(pg_class) BOOTSTRAP define the variable [var-name]	* define a variable for [var-name] as		#define Anum_pg_class_[var-name]			[value]	* And pass default value to DATA macro for that variable.
	* Change the value of 		Natts_pg_class_fixed from 25 to 26		Natts_pg_class from 26 to 27.   In pg_attribute	* in  #define Schema_pg_class added proper values for that [var-name].	* Then provided value to DATA macro for [var-name].
In heapam.c I add 0 in pg_class for that variable and perform simple heap_update for related tuple in pg_class..   In this way1. when I add variable after relacl in pg_class, it adds null for [var-nam] for tuples added in initdb.
2. when I creates a new table, it does not add the values I specified.  When I place it before relacl, initdb exits with a segmentation fault.  Is there any other file in which I have to make change ?
Regards   Rafaqat Ali