Re: [HACKERS] Request: set opclass for generated unique and primary key indexes

2006-02-22 Thread Pavel Stehule
Right, but does the pattern_ops one have to be unique? Sorry, I don't uderstand And if it does, do you need the normal unique constraint as well? Sometime yes. It's about using natural or generated unique values. I looked to source code and I propouse syntax: CREATE TABLE name .. colname t

Re: [HACKERS] A doubt..

2006-02-22 Thread Qingqing Zhou
"Dhanaraj" <[EMAIL PROTECTED]> wrote > Hi all > > I looked at B-tree and r-tree implementations. However i could not find > out where it is used. The secret is in index_getnext(), which is a general cap for all index access methods. First it retrieves the correct AM from the pg_am system catalog:

Re: [HACKERS] PostgreSQL unit tests

2006-02-22 Thread Jim C. Nasby
On Thu, Feb 23, 2006 at 01:40:06PM +1100, Gavin Sherry wrote: > I previously proposed integrating a unit test framework into PostgreSQL. > Getting started wasn't much fun and I gave up. This is because unit > testing is really suited to a functional programming model, IMHO. Testing > the most compl

Re: [HACKERS] PostgreSQL unit tests

2006-02-22 Thread Gavin Sherry
On Wed, 22 Feb 2006, Alvaro Herrera wrote: > Robert Treat wrote: > > > You could check into what spikesource has been doing. I believe they mostly > > just piggyback off of our regression tests for postgresql core, but there > > might still be something that could be built upon. If you look at t

Re: [HACKERS] PostgreSQL unit tests

2006-02-22 Thread Alvaro Herrera
Robert Treat wrote: > You could check into what spikesource has been doing. I believe they mostly > just piggyback off of our regression tests for postgresql core, but there > might still be something that could be built upon. If you look at this url > http://developer.spikesource.com/spikewa

Re: [HACKERS] Attempting upgrade path; is this possible?

2006-02-22 Thread Jim C. Nasby
On Thu, Feb 23, 2006 at 12:51:29AM +0200, Hannu Krosing wrote: > The requirement for (candidate) primary key's may still be prohibiting, > as currently creating an index on large table locks that table for > writes for the duration of create index. Plus, if the tables already have OIDs, you *might

Re: [HACKERS] Pgfoundry and gborg: shut one down

2006-02-22 Thread Jim C. Nasby
On Wed, Feb 22, 2006 at 04:26:27PM -0400, Marc G. Fournier wrote: > On Wed, 22 Feb 2006, Jim C. Nasby wrote: > > >So, is there a formal project setup anywhere for the migration? ISTM > >that it would be best to create a project on either gborg or pgfoundry > >with the intention that it produce a

[HACKERS] Which func tells the tuple size of a given relation?

2006-02-22 Thread John
I am hacking the parser to do multi-class-classification. I am wondering which function can tell the size of a relation. I tried to do something like int row_sz = 0; pgstat_count_heap_fetch(&rel->pgstat_info); row_sz = ((PgStat_TableEntry *)((&rel->pgstat_info)->tabe

Re: [HACKERS] Request: set opclass for generated unique and primary

2006-02-22 Thread Stephan Szabo
On Wed, 22 Feb 2006, Pavel Stehule wrote: > > > >I seem to recall someone proposing extending the syntax of the UNIQUE > > > >constraints themselves, but there really isn't enough use-case to > > > >justify it AFAICS. Especially not when you can always use CREATE > >UNIQUE > > > >INDEX. > > > >

Re: [HACKERS] Request: set opclass for generated unique and primary key indexes

2006-02-22 Thread Pavel Stehule
> >I seem to recall someone proposing extending the syntax of the UNIQUE > >constraints themselves, but there really isn't enough use-case to > >justify it AFAICS. Especially not when you can always use CREATE UNIQUE > >INDEX. > > I can always use second unique index. But it's redundant. This p

Re: [HACKERS] Attempting upgrade path; is this possible?

2006-02-22 Thread Gavin Sherry
On Wed, 22 Feb 2006, Shaun Thomas wrote: > I'm in charge of a very large database, and we're using a highly > decrepit version of Postgresql currently. After searching through the > archives, Google, and trying out several replication engines, I have a > question. > > I had originally considered

Re: [HACKERS] Attempting upgrade path; is this possible?

2006-02-22 Thread Hannu Krosing
Ühel kenal päeval, K, 2006-02-22 kell 16:02, kirjutas Shaun Thomas: > I'm in charge of a very large database, and we're using a highly decrepit > version of Postgresql currently. > After searching through the archives, Google, and trying out several > replication engines, I have a question. >

[HACKERS] Attempting upgrade path; is this possible?

2006-02-22 Thread Shaun Thomas
I'm in charge of a very large database, and we're using a highly decrepit version of Postgresql currently. After searching through the archives, Google, and trying out several replication engines, I have a question. I had originally considered Slony-I, as it doesn't seem to require version com

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Mark Kirkwood
Mark Woodward wrote: Admittedly, given that the binaries are likely to be in the cluster-owners default PATH, it is not as hard to find them as the data directory. However, this is all about convenience it would seem, since (for many *nix platforms) two simple searches will give you most of wh

Re: [HACKERS] Request: set opclass for generated unique and primary

2006-02-22 Thread Stephan Szabo
On Wed, 22 Feb 2006, Pavel Stehule wrote: > > > >Why would you need it? > I can't to use unique index for like_op without setting opclass, because I > have to use czech locale. I can create second index, but then I have two > equal indexes. Example: > > number | description > 000102 blabla bla >

Re: [HACKERS] Request: set opclass for generated unique and primary key indexes

2006-02-22 Thread Pavel Stehule
Why would you need it? I can't to use unique index for like_op without setting opclass, because I have to use czech locale. I can create second index, but then I have two equal indexes. Example: number | description 000102 blabla bla 000103 fooo number: varchar primary key. Someti

Re: [HACKERS] Pgfoundry and gborg: shut one down

2006-02-22 Thread Marc G. Fournier
On Wed, 22 Feb 2006, Jim C. Nasby wrote: So, is there a formal project setup anywhere for the migration? ISTM that it would be best to create a project on either gborg or pgfoundry with the intention that it produce a set of code/scripts/procedures that allow for migrating projects from gborg

Re: [HACKERS] Pgfoundry and gborg: shut one down

2006-02-22 Thread Jim C. Nasby
On Wed, Feb 22, 2006 at 01:11:46PM -0400, Marc G. Fournier wrote: > >Actually, it should be entirely possible to setup forwarding for > >projects as they migrate, one-by-one. AFAIK mailman will handle > >something like [EMAIL PROTECTED] being forwarded to > >[EMAIL PROTECTED] > > Woo hoo ... a mai

Re: [HACKERS] Divid by zero bug in float

2006-02-22 Thread Jim C. Nasby
On Wed, Feb 22, 2006 at 12:40:11PM -0500, Tom Lane wrote: > "Jim C. Nasby" <[EMAIL PROTECTED]> writes: > > Shouldn't this produce Infinity instead of an error? > > postgresql=# select 5::float/0::float; > > ERROR: division by zero > > No, I don't think so. SQL92 6.12 quoth: > > 4) The

Re: [HACKERS] Divid by zero bug in float

2006-02-22 Thread Tom Lane
"Jim C. Nasby" <[EMAIL PROTECTED]> writes: > Shouldn't this produce Infinity instead of an error? > postgresql=# select 5::float/0::float; > ERROR: division by zero No, I don't think so. SQL92 6.12 quoth: 4) The dyadic arithmetic operators , , , and (+, -, *, and /, respectively) spe

[HACKERS] Divid by zero bug in float

2006-02-22 Thread Jim C. Nasby
Shouldn't this produce Infinity instead of an error? postgresql=# select 5::float/0::float; ERROR: division by zero postgresql=# select 5::float/'Infinity'::float; ?column? -- 0 (1 row) postgresql=# -- Jim C. Nasby, Sr. Engineering Consultant [EMAIL PROTECTED] Pervasive S

Re: [HACKERS] windows / initdb oddness

2006-02-22 Thread Magnus Hagander
> >Is there any reason to worry about an accidental environment > conflict? > >If someone mistakenly did "export PG_RESTRICT_EXEC=1", it > looks to me > >like this would cause the re-exec bit to be skipped, but I > suppose the > >worst possible consequence is that the postmaster would > refus

Re: [HACKERS] windows / initdb oddness

2006-02-22 Thread Magnus Hagander
> > Thinking about this a tiny bit more, it struck me that by > far the best > > way to do this is to stop using a magic argument and use the > > environment instead. Then we don't need to mangle the > command line at > > all. This actually results in less code, and should be more robust > >

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Stephan Szabo
On Wed, 22 Feb 2006, Mark Woodward wrote: > > Mark Woodward wrote: > > > >> I'm not sure that I agree. At least in my experience, I wouldn't have > >> more > >> than one installation of PostgreSQL in a production machine. It is > >> potentially problematic. > >> > > > > I agree with you for produ

Re: [HACKERS] windows / initdb oddness

2006-02-22 Thread Andrew Dunstan
Tom Lane wrote: Is there any reason to worry about an accidental environment conflict? If someone mistakenly did "export PG_RESTRICT_EXEC=1", it looks to me like this would cause the re-exec bit to be skipped, but I suppose the worst possible consequence is that the postmaster would refuse to s

Re: [HACKERS] Pgfoundry and gborg: shut one down

2006-02-22 Thread Marc G. Fournier
On Wed, 22 Feb 2006, Jim C. Nasby wrote: On Mon, Feb 20, 2006 at 02:49:30PM +0700, Jeroen T. Vermeulen wrote: On Mon, February 20, 2006 11:00, Marc G. Fournier wrote: Speaking for libpqxx, my only concern with that is the mailing list. Would those have to move to different addresses--or conve

Re: [HACKERS] Memory profiling in postgreSQL

2006-02-22 Thread Jim C. Nasby
On Mon, Feb 20, 2006 at 03:51:40PM +0500, Rafaqat Ali wrote: > Hello all . > Can anyon eplz tell me how memory profiling is done in postgreSQL. I > read on a website I don't remember now that postgres creates a file > pgsql/data/base/dbname and stores memory profiling information in it. It doe

Re: [HACKERS] Pgfoundry and gborg: shut one down

2006-02-22 Thread Jim C. Nasby
On Mon, Feb 20, 2006 at 02:49:30PM +0700, Jeroen T. Vermeulen wrote: > On Mon, February 20, 2006 11:00, Marc G. Fournier wrote: > > >> Speaking for libpqxx, my only concern with that is the mailing list. > >> Would those have to move to different addresses--or conversely, would a > >> forced migra

Re: [HACKERS] windows / initdb oddness

2006-02-22 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Thinking about this a tiny bit more, it struck me that by far the best > way to do this is to stop using a magic argument and use the environment > instead. Then we don't need to mangle the command line at all. This > actually results in less code, an

Re: [HACKERS] Updated email signature

2006-02-22 Thread Jim C. Nasby
On Mon, Feb 20, 2006 at 11:26:47PM -0400, Marc G. Fournier wrote: > On Tue, 21 Feb 2006, Michael Glaesemann wrote: > > > > >On Feb 20, 2006, at 0:41 , Tom Dunstan wrote: > > > >>Andrew Dunstan wrote: > >> > >>>my *son* (whose name is Tom btw ;-) ) was 3 yrs old in '82 ... > >> > >>So, as you were

Re: [HACKERS] PL/pgSQL caught exceptions leak memory?

2006-02-22 Thread Tom Lane
Michael Fuhr <[EMAIL PROTECTED]> writes: > Caught exceptions in PL/pgSQL appear to leak memory -- is that > expected? This looks a bit messy :-(. The problem is that if the controlled statements within the BEGIN block leak any function-local memory (ie, memory in the "SPI Proc" context of the plp

Re: [HACKERS] windows / initdb oddness

2006-02-22 Thread Andrew Dunstan
Andrew Dunstan wrote: Magnus Hagander wrote: The solution would be put --restrictedexec earlier on the new command line. I'll work on that. The probem is apparently the one I identified above, and is fixed by the attached patch, which I will apply soon unless there are

Re: [HACKERS] LIMIT and JOINS

2006-02-22 Thread Tom Lane
"Gregor Zeitlinger" <[EMAIL PROTECTED]> writes: > select * from T1 join T2 on T1.id =3D T2.id LIMIT 1 > > Conceptually, it should be possible to fetch one row from T1 and T2, = > i.e. to propagate the LIMIT clause. > > I was wondering what the exact requirements are to propagate the LIMIT = > claus

[HACKERS] LIMIT and JOINS

2006-02-22 Thread Gregor Zeitlinger
Hi,   I have a question on implementation of the LIMIT SQL clause.   Using the LIMIT clause, I want to reduce the computation time for a query.   When I try to limit the result of a joined table, however, the join will be computed first (which takes very long).   Lets suppose the fo

Re: [HACKERS] Request: set opclass for generated unique and primary key indexes

2006-02-22 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > There isn't possibility change opclass for generated UNIQUE indexes. Why would you need it? > USING INDEX [TABLESPACE ..] [OPCLASS ..] This is unworkable --- consider a table with more than one unique constraint and/or multiple-column constraints.

[HACKERS] Request: set opclass for generated unique and primary key indexes

2006-02-22 Thread Pavel Stehule
Hello There isn't possibility change opclass for generated UNIQUE indexes. I found syntax for CREATE TABLE command USING INDEX TABLESPACE ..., This form can be enhanced to USING INDEX [TABLESPACE ..] [OPCLASS ..] What do you think about it? Regards Pavel Stehule ___

Re: [HACKERS] PostgreSQL unit tests

2006-02-22 Thread Tom Lane
Michael Glaesemann <[EMAIL PROTECTED]> writes: > Something that has been briefly discussed in the past wrt PostgreSQL > has been unit testing to complement the current regression tests. I was and remain pretty dubious of this idea. In the backend in particular, there is very little code that

[HACKERS] A doubt..

2006-02-22 Thread Dhanaraj
Hi all I looked at B-tree and r-tree implementations. However i could not find out where it is used. It seems that the data retrieved from the data base is kept in the tuple data structure. I am not clear in that. please some one help me.. Thanks Dhanaraj ---(end of

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Mark Woodward
> Mark Woodward wrote: > >> I'm not sure that I agree. At least in my experience, I wouldn't have >> more >> than one installation of PostgreSQL in a production machine. It is >> potentially problematic. >> > > I agree with you for production environments, but for development, test, > support (and

Re: [HACKERS] PostgreSQL unit tests

2006-02-22 Thread Robert Treat
On Wednesday 22 February 2006 01:27, Michael Glaesemann wrote: > During Josh Berkus' presentation at the JPUG PostgreSQL Conference, I > was particularly struck by the fact that 8.1 had a shorter beta > period than previous releases, rolled out on time, and enjoyed a > longer period before the firs

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Mark Woodward
> Quoth [EMAIL PROTECTED] ("Mark Woodward"): >>> Mark Woodward wrote: As a guy who administers a lot of systems, sometimes over the span of years, I can not understate the need for "a" place for the admin to find what databases are on the machine and where they are located. >>>

Re: [HACKERS] PostgreSQL unit tests

2006-02-22 Thread Andrew Dunstan
Lukas Smith wrote: Michael Glaesemann wrote: During Josh Berkus' presentation at the JPUG PostgreSQL Conference, I was particularly struck by the fact that 8.1 had a shorter beta period than previous releases, rolled out on time, and enjoyed a longer period before the first post-release bu

Re: [HACKERS] windows / initdb oddness

2006-02-22 Thread Andrew Dunstan
Magnus Hagander wrote: The solution would be put --restrictedexec earlier on the new command line. I'll work on that. The probem is apparently the one I identified above, and is fixed by the attached patch, which I will apply soon unless there are objections. As for

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Andreas Pflug
Peter Eisentraut wrote: Am Mittwoch, 22. Februar 2006 09:06 schrieb Dave Page: As an example, pgAdmin uses this info to automatically register any local installations. Curiously enough, pgAdmin already has a "Service" field in its connection dialog, but I guess that isn't the same thing. T

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Peter Eisentraut
Am Mittwoch, 22. Februar 2006 09:06 schrieb Dave Page: > As an example, pgAdmin uses this info to automatically register any > local installations. Curiously enough, pgAdmin already has a "Service" field in its connection dialog, but I guess that isn't the same thing. The documentation is unclea

Re: [HACKERS] pg_config, pg_service.conf, postgresql.conf ....

2006-02-22 Thread Dave Page
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Mark Kirkwood > Sent: 22 February 2006 01:53 > To: Mark Woodward > Cc: Tom Lane; Peter Eisentraut; kleptog@svana.org; > pgsql-hackers@postgresql.org > Subject: Re: [HACKERS] pg_config, pg_service.co