[HACKERS] Question about explain of index scan

2005-09-02 Thread Hannu Krosing
How does Index scan perform a scan for overlapping Index Cond ? If I get a plan like this, what will actually be performed if EXPLAIN shows this: Sort (cost=12.90..12.91 rows=1 width=207) Sort Key: log_actionseq - Index Scan using sl_log_1_idx2_hu, sl_log_1_idx2_hu, sl_log_1_idx2_hu,

[HACKERS] Proof of concept COLLATE support with patch

2005-09-02 Thread Martijn van Oosterhout
Supports any glibc platform and possibly Win32. Adds: SELECT ... ORDER BY expr COLLATE 'locale' CREATE INDEX locale_index ON table(expr COLLATE 'locale') Index scan used when COLLATE order permits This is just a proof of concept patch. I didn't send it to -patches because as Tom pointed

Re: [HACKERS] Call for 7.5 feature completion

2005-09-02 Thread Merlin Moncure
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

Re: [HACKERS] PL/pgSQL: EXCEPTION NOSAVEPOINT

2005-09-02 Thread Matt Miller
Rewriting all my Oracle code function-by-function could be painful ... I'm still trying to hold on to my fantasy that I can hack Postgres (and contrib/ora2pg) into submission. Why don't you just use EnterpriseDB? I looked at EnterpriseDB a few months ago. The installation errored. It

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Tom Lane
Hannu Krosing [EMAIL PROTECTED] writes: If I get a plan like this, what will actually be performed if EXPLAIN shows this: Sort (cost=12.90..12.91 rows=1 width=207) Sort Key: log_actionseq - Index Scan using sl_log_1_idx2_hu, sl_log_1_idx2_hu, sl_log_1_idx2_hu, sl_log_1_idx2_hu on

Re: [HACKERS] Call for 7.5 feature completion

2005-09-02 Thread Magnus Hagander
I think the most popular method to build a project on Win32 is using MSVC or Intel C. Intel C can be integrated with MSVC's IDE to help developers increase their productivity. Actually I have tried to make the backend of pgsql-8.0.3 build with MSVC 6.0, and it works well. Should I

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 10:31:45AM -0400, Tom Lane wrote: Hannu Krosing [EMAIL PROTECTED] writes: If I get a plan like this, what will actually be performed if EXPLAIN shows this: Sort (cost=12.90..12.91 rows=1 width=207) Sort Key: log_actionseq - Index Scan using

Re: [HACKERS] PL/pgSQL: EXCEPTION NOSAVEPOINT

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 02:34:50PM +, Matt Miller wrote: Rewriting all my Oracle code function-by-function could be painful ... I'm still trying to hold on to my fantasy that I can hack Postgres (and contrib/ora2pg) into submission. Why don't you just use EnterpriseDB? I

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

2005-09-02 Thread Greg Stark
Martijn van Oosterhout kleptog@svana.org writes: Supports any glibc platform and possibly Win32. Adds: SELECT ... ORDER BY expr COLLATE 'locale' CREATE INDEX locale_index ON table(expr COLLATE 'locale') Index scan used when COLLATE order permits This is just a proof of concept

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I wonder why we don't support more operators on Xid, so these things are avoided? Right now we only have =, AFAIR. I once started to make a btree opclass for XID, and stopped when it occurred to me that XID comparison doesn't obey the transitive law.

Re: [HACKERS] Call for 7.5 feature completion

2005-09-02 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: Building with the VC compiler using GNU makefiles is a whole different story - if that can be made to work reasonably easily it would be a worthwhile goal (in my experience, for example, the VSEE compiler optimises things a whole lot better than gcc on

Re: [HACKERS] GRANT/roles problem: grant is shown as from login role

2005-09-02 Thread Stephen Frost
* Tom Lane ([EMAIL PROTECTED]) wrote: This is looking a bit messy. Maybe for GRANT/REVOKE, we have to insist that privileges do not inherit, you have to actually be SET ROLE'd to whatever role has the authority to do the grant. I haven't figured out how the SQL spec avoids this problem,

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Hannu Krosing
On R, 2005-09-02 at 10:31 -0400, Tom Lane wrote: Hannu Krosing [EMAIL PROTECTED] writes: If I get a plan like this, what will actually be performed if EXPLAIN shows this: Sort (cost=12.90..12.91 rows=1 width=207) Sort Key: log_actionseq - Index Scan using sl_log_1_idx2_hu,

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 11:03:24AM -0400, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I wonder why we don't support more operators on Xid, so these things are avoided? Right now we only have =, AFAIR. I once started to make a btree opclass for XID, and stopped when it

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

2005-09-02 Thread Tom Lane
Greg Stark [EMAIL PROTECTED] writes: I still doesn't get where the hostility towards this functionality comes from. We're not really willing to say here is a piece of syntax REQUIRED BY THE SQL SPEC which we only support on some platforms. readline, O_DIRECT, and the like are a completely

Re: [HACKERS] Call for 7.5 feature completion

2005-09-02 Thread Zeugswetter Andreas DAZ SD
I think the main problem with switching to visual studio project files is maintainabilty. (It's not easy to get all I think the target should be a way to auto create those files with gmake (maybe with mingw for configure). The format of VS6 project and workspace files is pretty simple. It

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Tom Lane
Hannu Krosing [EMAIL PROTECTED] writes: On R, 2005-09-02 at 10:31 -0400, Tom Lane wrote: Yes. However, I don't understand how you got that result; AFAIK the planner should have eliminated the duplicate subclauses. the query was similar to this: [snip] Oh, the OR arms are actually *not*

Re: [HACKERS] Question about explain of index scan

2005-09-02 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: On Fri, Sep 02, 2005 at 11:03:24AM -0400, Tom Lane wrote: I once started to make a btree opclass for XID, and stopped when it occurred to me that XID comparison doesn't obey the transitive law. Not having it does affect the planner somehow, right?

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

2005-09-02 Thread Martijn van Oosterhout
On Fri, Sep 02, 2005 at 03:04:20PM +0200, Martijn van Oosterhout wrote: Supports any glibc platform and possibly Win32. MacOS X [1] supports this also apparently. And for glibc it appears to have been accepted as part of the API since 2.3.2 and formally accepted into LSB3.0. Win32 claims to have

Re: [HACKERS] PL/pgSQL: EXCEPTION NOSAVEPOINT

2005-09-02 Thread Christopher Kings-Lynne
I looked at EnterpriseDB a few months ago. The installation errored. It left stuff in /var/opt, which I consider non-standard for a Red Hat machine. The whole product just didn't feel clean to me. I admit that's a pretty limited and subjective evaluation, especially for a beta product, but I

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

2005-09-02 Thread Tom Lane
Martijn van Oosterhout kleptog@svana.org writes: [1] http://www.hmug.org/man/3/newlocale.php Hmm, the more general page seems to be http://www.hmug.org/man/3/xlocale.php This seems to be pretty much exactly what we want, at least API-wise. Now, if we can find an implementation of this with a

Re: [HACKERS] PL/pgSQL: EXCEPTION NOSAVEPOINT

2005-09-02 Thread Tom Lane
Christopher Kings-Lynne [EMAIL PROTECTED] writes: The EnterpriseDB guys have a final product now, and it's designed to emulate Oracle as much as possible. The question at hand is whether as much as possible includes having reinvented plpgsql's execution engine ... I have not seen their

[HACKERS] dbt-4 (tpc-app) kit

2005-09-02 Thread Mark Wong
Hi everyone, I've starting putting together a kit based on the TPC-App, which is a business-to-business Web services workload. I'm starting to implement it as a Java EJB and have the most of the interactions implemented with a simple single threaded driver. The code is available here:

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

2005-09-02 Thread Martijn van Oosterhout
On Fri, Sep 02, 2005 at 12:44:00PM -0400, Tom Lane wrote: Hmm, the more general page seems to be http://www.hmug.org/man/3/xlocale.php This seems to be pretty much exactly what we want, at least API-wise. Now, if we can find an implementation of this with a BSD license ;-) ... Yes it

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

2005-09-02 Thread AgentM
The sources can be found here: http://darwinsource.opendarwin.org/10.4.2/Libc-391/locale/xlocale.c The Apple License *is* necessarily compatible with the BSD License. http://www.gnu.org/philosophy/apsl.html On Sep 2, 2005, at 11:44 AM, Tom Lane wrote: Martijn van Oosterhout kleptog@svana.org

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Pailloncy Jean-Gerard
[skip] happening in the bgwriter's inner loop. Even more to the point, you can't do such changes without getting a superexclusive lock on the page (not only locked, but no one else has it pinned), which is a real nonstarter for the bgwriter, both for performance and possible deadlock

Re: [HACKERS] Two different defs of MAX_TUPLES_PER_PAGE

2005-09-02 Thread Tom Lane
ITAGAKI Takahiro [EMAIL PROTECTED] writes: Don't you think about PageHeaderData? I doubt it's really worth taking into account ... we can though. Also I guess a floor definition is ok because 'number of tuples' is an integer. Right, now that I'm more awake I agree with that ;-) Also, is

Re: [HACKERS] upgrade path / versioning roles

2005-09-02 Thread Patrick Welche
On Thu, Sep 01, 2005 at 02:59:37PM -0400, Tom Lane wrote: Patrick Welche [EMAIL PROTECTED] writes: I tried the fix mentioned in the earlier message to encourage validation. Now dumping this fixed database, and loadinging it into the new database gives: ALTER FUNCTION

Re: Procedural language definitions (was Re: [HACKERS] 8.1 and syntax checking at create time)

2005-09-02 Thread elein
On Wed, Aug 31, 2005 at 05:56:52PM -0400, Tom Lane wrote: I wrote: We've had repeated problems with PL languages stemming from the fact that pg_dump dumps them at a pretty low semantic level. Aside from this problem with adding a validator, we used to have issues with hardwired paths to

Re: Procedural language definitions (was Re: [HACKERS] 8.1 and syntax checking at create time)

2005-09-02 Thread Tom Lane
[EMAIL PROTECTED] (elein) writes: On Wed, Aug 31, 2005 at 05:56:52PM -0400, Tom Lane wrote: The basic idea is to create a shared catalog that contains procedural language templates. This catalog would essentially replace the knowledge that's now hardwired in the createlang program. ... It's

Re: Procedural language definitions (was Re: [HACKERS] 8.1 and syntax

2005-09-02 Thread Andrew Dunstan
elein wrote: On Wed, Aug 31, 2005 at 05:56:52PM -0400, Tom Lane wrote: [ interesting scheme for language handlers ] It's a shame that we didn't think about this before feature freeze, as the recent changes to create PL support functions in pg_catalog have made both pg_dump and createlang

Re: [HACKERS] dbt-4 (tpc-app) kit

2005-09-02 Thread Dave Cramer
Mark, I'd like to help out, let me know what you need help doing. Personally, doing this with EJB's is distasteful, but I'll help where I can. Dave On 2-Sep-05, at 12:53 PM, Mark Wong wrote: Hi everyone, I've starting putting together a kit based on the TPC-App, which is a

Re: [HACKERS] Call for 7.5 feature completion

2005-09-02 Thread Bruce Momjian
William ZHANG wrote: - Original Message - From: Dave Page dpage@vale-housing.co.uk To: Andrew Dunstan [EMAIL PROTECTED]; William ZHANG [EMAIL PROTECTED] Cc: pgsql-hackers@postgresql.org Sent: Thursday, September 01, 2005 3:21 PM Subject: RE: [HACKERS] Call for 7.5 feature

Re: [HACKERS] PL/pgSQL: EXCEPTION NOSAVEPOINT

2005-09-02 Thread Josh Berkus
Matt, Seriously, though, I'm willing to devote considerable time to this. Rewriting all my Oracle code function-by-function could be painful, and I would end up dragging other people around this company into it.  I'm still trying to hold on to my fantasy that I can hack Postgres (and

[HACKERS] sequences TODO items

2005-09-02 Thread Jaime Casanova
Hi, i'm looking for some item i can do and that have enough consensus to make it worth the effort... :) * Have sequence dependency track use of DEFAULT sequences, seqname.nextval? what this means? i don't understand it... * %Disallow changing default expression of a SERIAL column? why? a

Re: [HACKERS] dbt-4 (tpc-app) kit

2005-09-02 Thread Mark Wong
Hi Dave, Oops, EJB's are distasteful? My experience in this area is quite lacking. Not that I necessarily want to be 100% strict but the spec says this needs to conform to WS-I BP 1.0 specification, which I understand is basically using the SOAP transport? I just thought it would be nice to

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Bruce Momjian
Tom Lane wrote: Of course, it's fair to ask whether such a program would be any faster than binary-mode COPY by the time you got done ... or enough faster to justify your effort, anyway. THe only fundamental disadvantage that COPY labors under is having to write WAL records. It might be

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Bruce Momjian
Tom Lane wrote: ITAGAKI Takahiro [EMAIL PROTECTED] writes: I think it would be a waste to retain xmin and cmin for frozen tuples because their values represent only 'visible for all transactions'. True, but the hard part is getting rid of the storage for them. I wrote a makeshift patch

Re: Procedural language definitions (was Re: [HACKERS] 8.1 and syntax checking at create time)

2005-09-02 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: I agree with Tom that it should not be done at this stage of beta. But maybe we should look again at the much lower impact suggestion I made when we moved the handlers and validators to pg_catalog, which was to have pg_dump also do that move rather

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Tom Lane
Bruce Momjian pgman@candle.pha.pa.us writes: Tom Lane wrote: THe only fundamental disadvantage that COPY labors under is having to write WAL records. It might be interesting to do something similar to the recent hacks for CREATE TABLE AS, so that a COPY into a table just created in the

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Tom Lane
Bruce Momjian pgman@candle.pha.pa.us writes: Considering the cost/benefits, rather than doing some optimization for long-lived tuples, I would like to see us merge the existing xmin/xmax/cmin/cmax values back into three storage fields like we had in 7.4 and had to expand to a full four in 8.0

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 04:02:08PM -0400, Tom Lane wrote: Bruce Momjian pgman@candle.pha.pa.us writes: Tom Lane wrote: THe only fundamental disadvantage that COPY labors under is having to write WAL records. It might be interesting to do something similar to the recent hacks for CREATE

Re: Procedural language definitions (was Re: [HACKERS] 8.1 and syntax

2005-09-02 Thread Andrew Dunstan
Tom Lane wrote: I feel the best idea for a non-initdb-forcing solution is to hardwire the template knowledge into CREATE LANGUAGE for 8.1 (with of course the intention of doing my full original proposal for 8.2). With that in place, the only messiness from loading old dumps is that you

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Josh Berkus
Tom, Alvaro, It has to be a *new* table, not an *empty* table. If it's already visible to other xacts then somebody else could insert into it in parallel with you, because COPY doesn't take an exclusive lock. There's still major gains to be had, for ETL, in being able to disable logging

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Josh Berkus
People: Bruce Momjian pgman@candle.pha.pa.us writes: Considering the cost/benefits, rather than doing some optimization for long-lived tuples, I would like to see us merge the existing xmin/xmax/cmin/cmax values back into three storage fields like we had in 7.4 and had to expand to a

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: On Fri, Sep 02, 2005 at 04:02:08PM -0400, Tom Lane wrote: It has to be a *new* table, not an *empty* table. If it's already visible to other xacts then somebody else could insert into it in parallel with you, because COPY doesn't take an exclusive

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 04:27:59PM -0400, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Contrariwise, it doesn't really matter (I think) if there are WAL-logged records already in the table and COPY is adding more that aren't logged. Only if the page is locked in a fashion

Re: Procedural language definitions (was Re: [HACKERS] 8.1 and syntax checking at create time)

2005-09-02 Thread Tom Lane
Andrew Dunstan [EMAIL PROTECTED] writes: Tom Lane wrote: I feel the best idea for a non-initdb-forcing solution is to hardwire the template knowledge into CREATE LANGUAGE for 8.1 (with of course the intention of doing my full original proposal for 8.2). With that in place, the only messiness

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

2005-09-02 Thread Bruce Momjian
AgentM wrote: The sources can be found here: http://darwinsource.opendarwin.org/10.4.2/Libc-391/locale/xlocale.c The Apple License *is* necessarily compatible with the BSD License. http://www.gnu.org/philosophy/apsl.html Does compatibile mean our combined work is still BSD licensed?

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 01:30:58PM -0700, Josh Berkus wrote: Contrariwise, it doesn't really matter (I think) if there are WAL-logged records already in the table and COPY is adding more that aren't logged. (You might have to force COPY to start adding the rows on freshly added pages ...

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 01:35:42PM -0700, Josh Berkus wrote: Bruce Momjian pgman@candle.pha.pa.us writes: Considering the cost/benefits, rather than doing some optimization for long-lived tuples, I would like to see us merge the existing xmin/xmax/cmin/cmax values back into three

Re: [HACKERS] sequences TODO items

2005-09-02 Thread Bruce Momjian
Jaime Casanova wrote: Hi, i'm looking for some item i can do and that have enough consensus to make it worth the effort... :) * Have sequence dependency track use of DEFAULT sequences, seqname.nextval? what this means? i don't understand it... The idea is to automatically add a

Re: [HACKERS] Ora2Pg (was PL/pgSQL: EXCEPTION NOSAVEPOINT)

2005-09-02 Thread Matt Miller
On Fri, 2005-09-02 at 12:29 -0700, Josh Berkus wrote: still trying to hold on to my fantasy that I can hack Postgres (and contrib/ora2pg) into submission. I'm happy to work with you on ora2pg Cool. It looks like I should have referred to contrib/oracle, not contrib/ora2pg, but you got my

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Bruce Momjian
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: On Fri, Sep 02, 2005 at 04:02:08PM -0400, Tom Lane wrote: It has to be a *new* table, not an *empty* table. If it's already visible to other xacts then somebody else could insert into it in parallel with you, because COPY doesn't

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: On Fri, Sep 02, 2005 at 01:35:42PM -0700, Josh Berkus wrote: Where I do see value is in enabling index-only access for frozen tables. That would be a *huge* gain, especially with bitmaps. I think we've discussed this before, though. That's a

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Tom Lane
Bruce Momjian pgman@candle.pha.pa.us writes: Updated TODO: o Allow COPY on a newly-created table to skip WAL logging On crash recovery, the table involved in the COPY would have its heap and index files truncated. One issue is that no other backend

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Bruce Momjian
Tom Lane wrote: Bruce Momjian pgman@candle.pha.pa.us writes: Updated TODO: o Allow COPY on a newly-created table to skip WAL logging On crash recovery, the table involved in the COPY would have its heap and index files truncated. One issue is

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 05:18:09PM -0400, Tom Lane wrote: Bruce Momjian pgman@candle.pha.pa.us writes: Updated TODO: o Allow COPY on a newly-created table to skip WAL logging On crash recovery, the table involved in the COPY would have its heap and index

Re: [HACKERS] Proof of concept COLLATE support with p.tch

2005-09-02 Thread Alvaro Herrera
On Fri, Sep 02, 2005 at 04:49:03PM -0400, Bruce Momjian wrote: AgentM wrote: The sources can be found here: http://darwinsource.opendarwin.org/10.4.2/Libc-391/locale/xlocale.c The Apple License *is* necessarily compatible with the BSD License. http://www.gnu.org/philosophy/apsl.html

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

2005-09-02 Thread Bruce Momjian
I have applied the following patch to output unnamed for unnamed prepared statements. As far as your other issues, how would you want server-side statements to be logged? statement: is a log label for a statement. What else should we use?

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I remember somebody mentioned some time ago that if you create a table and then crash before ending the transaction, the tuple in pg_class is no longer valid, but the file remains. Right --- it will be removed on transaction rollback, but not if the

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Manfred Koizar
On Fri, 2 Sep 2005 15:51:15 -0400 (EDT), Bruce Momjian pgman@candle.pha.pa.us wrote: * Merge xmin/xmax/cmin/cmax back into three header fields And don't forget xvac, please. Before subtransactions, there used to be only three fields needed to store these four

Re: [HACKERS] Remove xmin and cmin from frozen tuples

2005-09-02 Thread Bruce Momjian
Manfred Koizar wrote: On Fri, 2 Sep 2005 15:51:15 -0400 (EDT), Bruce Momjian pgman@candle.pha.pa.us wrote: * Merge xmin/xmax/cmin/cmax back into three header fields And don't forget xvac, please. Before subtransactions, there used to be only three fields needed to