Commit cc2b5e58 authored by Bruce Momjian's avatar Bruce Momjian

Remove NT-specific file open defines by defining our own open macros for

"rb" and "wb".
parent bf1c8f2b
...@@ -34,7 +34,8 @@ Copy pg_ident.conf.sample into /lib directory in install (Bruce) ...@@ -34,7 +34,8 @@ Copy pg_ident.conf.sample into /lib directory in install (Bruce)
Add SJIS UDC (NEC selection IBM kanji) support (Eiji Tokuya) Add SJIS UDC (NEC selection IBM kanji) support (Eiji Tokuya)
Fix too long syslog message (Tatsuo) Fix too long syslog message (Tatsuo)
Fix problem with quoted indexes that are too long (Tom) Fix problem with quoted indexes that are too long (Tom)
JDBC ResultSet.getTimestamp() fix (Gregory Krasnow & Floyd Marinescu)
ecpg changes (Michael)
------------------------------------------------------------------------ ------------------------------------------------------------------------
Release 7.0 Release 7.0
......
TODO list for PostgreSQL TODO list for PostgreSQL
======================== ========================
Last updated: Thu May 25 12:08:57 EDT 2000 Last updated: Fri Jun 2 11:32:09 EDT 2000
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us) Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
...@@ -234,6 +234,7 @@ MISC ...@@ -234,6 +234,7 @@ MISC
* Remove ANALYZE from VACUUM so it can be run separately without locks * Remove ANALYZE from VACUUM so it can be run separately without locks
* Gather more accurate statistics using indexes * Gather more accurate statistics using indexes
* Improve statistics storage in pg_class [performance] * Improve statistics storage in pg_class [performance]
* Improve VACUUM speed with indexes [vacuum]
SOURCE CODE SOURCE CODE
----------- -----------
...@@ -241,7 +242,7 @@ SOURCE CODE ...@@ -241,7 +242,7 @@ SOURCE CODE
* Fix C optimizer problem where fmgr_ptr calls return different types [alpha] * Fix C optimizer problem where fmgr_ptr calls return different types [alpha]
* Does Mariposa source contain any other bug fixes? * Does Mariposa source contain any other bug fixes?
* Remove SET KSQO option now that OR processing is improved(Tom) * Remove SET KSQO option now that OR processing is improved(Tom)
* Use macros to define NT open() file parameters, remove NT-specific defines * -Use macros to define NT open() file parameters, remove NT-specific defines
* Change CURRENT to OLD internally for rules * Change CURRENT to OLD internally for rules
* rename pl/tcl to pl/pltcl * rename pl/tcl to pl/pltcl
......
From Inoue@tpf.co.jp Tue Jan 18 19:08:30 2000 From Inoue@tpf.co.jp Tue Jan 18 19:08:30 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA10148
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 20:08:27 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id KAA02790; Wed, 19 Jan 2000 10:08:02 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp> From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us> To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org> Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 10:13:40 +0900 Date: Wed, 19 Jan 2000 10:13:40 +0900
Message-ID: <000201bf621a$6b9baf20$2801007e@tpf.co.jp> Message-ID: <000201bf621a$6b9baf20$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal Importance: Normal
In-Reply-To: <200001181821.NAA02988@candle.pha.pa.us> In-Reply-To: <200001181821.NAA02988@candle.pha.pa.us>
Content-Length: 1479 Status: ORr
[ Charset ISO-8859-1 unsupported, converting... ]
> -----Original Message----- > -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] > From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> >
...@@ -68,12 +77,35 @@ Hiroshi Inoue ...@@ -68,12 +77,35 @@ Hiroshi Inoue
Inoue@tpf.co.jp Inoue@tpf.co.jp
From owner-pgsql-hackers@hub.org Tue Jan 18 19:15:27 2000 From owner-pgsql-hackers@hub.org Tue Jan 18 19:15:27 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA10454
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 20:15:26 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id UAA42280;
Tue, 18 Jan 2000 20:10:35 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 20:10:30 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id UAA42081
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 20:09:31 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA41943
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 20:08:39 -0500 (EST)
(envelope-from Inoue@tpf.co.jp)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id KAA02790; Wed, 19 Jan 2000 10:08:02 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp> From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us> To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org> Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 10:13:40 +0900 Date: Wed, 19 Jan 2000 10:13:40 +0900
Message-ID: <000201bf621a$6b9baf20$2801007e@tpf.co.jp> Message-ID: <000201bf621a$6b9baf20$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
...@@ -81,9 +113,8 @@ X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 ...@@ -81,9 +113,8 @@ X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal Importance: Normal
In-Reply-To: <200001181821.NAA02988@candle.pha.pa.us> In-Reply-To: <200001181821.NAA02988@candle.pha.pa.us>
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 1493 Status: OR
[ Charset ISO-8859-1 unsupported, converting... ]
> -----Original Message----- > -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] > From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> >
...@@ -140,6 +171,25 @@ Inoue@tpf.co.jp ...@@ -140,6 +171,25 @@ Inoue@tpf.co.jp
************ ************
From owner-pgsql-hackers@hub.org Tue Jan 18 19:57:21 2000 From owner-pgsql-hackers@hub.org Tue Jan 18 19:57:21 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id UAA11764
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 20:57:19 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id UAA50653;
Tue, 18 Jan 2000 20:52:38 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 20:52:30 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id UAA50513
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 20:51:32 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id UAA50462
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 20:51:06 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id UAA11421;
Tue, 18 Jan 2000 20:50:50 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us> From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001190150.UAA11421@candle.pha.pa.us> Message-Id: <200001190150.UAA11421@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum Subject: Re: [HACKERS] Index recreation in vacuum
...@@ -149,8 +199,11 @@ To: Hiroshi Inoue <Inoue@tpf.co.jp> ...@@ -149,8 +199,11 @@ To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 18 Jan 2000 20:50:50 -0500 (EST) Date: Tue, 18 Jan 2000 20:50:50 -0500 (EST)
CC: pgsql-hackers <pgsql-hackers@postgreSQL.org> CC: pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 2329 Status: ORr
> > > Add a new option to force index recreation in vacuum > > > Add a new option to force index recreation in vacuum
> > > and if index recreation is specified. > > > and if index recreation is specified.
...@@ -208,6 +261,9 @@ old copy of the index. ...@@ -208,6 +261,9 @@ old copy of the index.
************ ************
From pgman Tue Jan 18 20:04:11 2000 From pgman Tue Jan 18 20:04:11 2000
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id VAA11990;
Tue, 18 Jan 2000 21:04:11 -0500 (EST)
From: Bruce Momjian <pgman> From: Bruce Momjian <pgman>
Message-Id: <200001190204.VAA11990@candle.pha.pa.us> Message-Id: <200001190204.VAA11990@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum Subject: Re: [HACKERS] Index recreation in vacuum
...@@ -218,7 +274,10 @@ Date: Tue, 18 Jan 2000 21:04:11 -0500 (EST) ...@@ -218,7 +274,10 @@ Date: Tue, 18 Jan 2000 21:04:11 -0500 (EST)
CC: Hiroshi Inoue <Inoue@tpf.co.jp>, CC: Hiroshi Inoue <Inoue@tpf.co.jp>,
pgsql-hackers <pgsql-hackers@postgreSQL.org> pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Mailer: ELM [version 2.4ME+ PL66 (25)]
Content-Length: 2434 MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Status: OR
> > I don't know how people estimate this disadvantage. > > I don't know how people estimate this disadvantage.
> >
...@@ -270,21 +329,30 @@ old index around, but the index is invalid anyway, right? ...@@ -270,21 +329,30 @@ old index around, but the index is invalid anyway, right?
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026 + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
From Inoue@tpf.co.jp Tue Jan 18 20:18:48 2000 From Inoue@tpf.co.jp Tue Jan 18 20:18:48 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA12437
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 21:18:46 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id LAA02845; Wed, 19 Jan 2000 11:18:18 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp> From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us> To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org> Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 11:23:55 +0900 Date: Wed, 19 Jan 2000 11:23:55 +0900
Message-ID: <000801bf6224$3bfdd9a0$2801007e@tpf.co.jp> Message-ID: <000801bf6224$3bfdd9a0$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal Importance: Normal
In-Reply-To: <200001190204.VAA11990@candle.pha.pa.us> In-Reply-To: <200001190204.VAA11990@candle.pha.pa.us>
Content-Length: 2308 Status: ORr
[ Charset ISO-8859-1 unsupported, converting... ]
> -----Original Message----- > -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] > From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> >
...@@ -337,6 +405,25 @@ Inoue@tpf.co.jp ...@@ -337,6 +405,25 @@ Inoue@tpf.co.jp
From owner-pgsql-hackers@hub.org Tue Jan 18 20:53:49 2000 From owner-pgsql-hackers@hub.org Tue Jan 18 20:53:49 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id VAA13285
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 21:53:47 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id VAA65183;
Tue, 18 Jan 2000 21:47:47 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 21:47:33 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id VAA65091
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 21:46:33 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id VAA65034
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 21:46:12 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id VAA13040;
Tue, 18 Jan 2000 21:45:27 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us> From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001190245.VAA13040@candle.pha.pa.us> Message-Id: <200001190245.VAA13040@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum Subject: Re: [HACKERS] Index recreation in vacuum
...@@ -346,8 +433,11 @@ To: Hiroshi Inoue <Inoue@tpf.co.jp> ...@@ -346,8 +433,11 @@ To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 18 Jan 2000 21:45:27 -0500 (EST) Date: Tue, 18 Jan 2000 21:45:27 -0500 (EST)
CC: pgsql-hackers <pgsql-hackers@postgreSQL.org> CC: pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 2480 Status: OR
> > > In fact, for REINDEX cases where you don't have a lock on the entire > > > In fact, for REINDEX cases where you don't have a lock on the entire
> > > table as you do in vacuum, you could reindex the table with a simple > > > table as you do in vacuum, you could reindex the table with a simple
...@@ -398,6 +488,25 @@ of using 2x the disk space. Seems like a big win. ...@@ -398,6 +488,25 @@ of using 2x the disk space. Seems like a big win.
************ ************
From owner-pgsql-hackers@hub.org Tue Jan 18 21:15:24 2000 From owner-pgsql-hackers@hub.org Tue Jan 18 21:15:24 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA14115
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 22:15:23 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id WAA72950;
Tue, 18 Jan 2000 22:10:40 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Tue, 18 Jan 2000 22:10:32 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id WAA72644
for pgsql-hackers-outgoing; Tue, 18 Jan 2000 22:09:36 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id WAA72504
for <pgsql-hackers@postgreSQL.org>; Tue, 18 Jan 2000 22:08:40 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id WAA13965;
Tue, 18 Jan 2000 22:08:25 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us> From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001190308.WAA13965@candle.pha.pa.us> Message-Id: <200001190308.WAA13965@candle.pha.pa.us>
Subject: Re: [HACKERS] Index recreation in vacuum Subject: Re: [HACKERS] Index recreation in vacuum
...@@ -407,27 +516,72 @@ To: Hiroshi Inoue <Inoue@tpf.co.jp> ...@@ -407,27 +516,72 @@ To: Hiroshi Inoue <Inoue@tpf.co.jp>
Date: Tue, 18 Jan 2000 22:08:25 -0500 (EST) Date: Tue, 18 Jan 2000 22:08:25 -0500 (EST)
CC: pgsql-hackers <pgsql-hackers@postgreSQL.org> CC: pgsql-hackers <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=UNKNOWN-8BIT
Content-Transfer-Encoding: 8bit
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 50 Status: OR
[ Charset UNKNOWN-8BIT unsupported, skipping... ] > I heard from someone that old vacuum had been like so.
> Probably 2x disk space for big tables was a big disadvantage.
That's interesting.
>
> In addition,rename(),unlink(),mv aren't preferable for transaction
> control as far as I see. We couldn't avoid inconsistency using
> those OS functions.
I disagree. Vacuum can't be rolled back anyway in the sense you can
bring back expire tuples, though I have no idea why you would want to.
You have an exclusive lock on the table. Putting new heap/indexes in
place that match and have no expired tuples seems like it can not fail
in any situation.
Of course, the buffers of the old table have to be marked as invalid,
but with an exclusive lock, that is not a problem. I am sure we do that
anyway in vacuum.
> We have to wait the change of relation file naming if copying
> vacuum is needed.
> Under the spec we need not rename(),mv etc.
Sorry, I don't agree, yet...
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From Inoue@tpf.co.jp Tue Jan 18 21:05:23 2000 From Inoue@tpf.co.jp Tue Jan 18 21:05:23 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id WAA13858
for <pgman@candle.pha.pa.us>; Tue, 18 Jan 2000 22:05:21 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id MAA02870; Wed, 19 Jan 2000 12:04:55 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp> From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us> To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org> Cc: "pgsql-hackers" <pgsql-hackers@postgreSQL.org>
Subject: RE: [HACKERS] Index recreation in vacuum Subject: RE: [HACKERS] Index recreation in vacuum
Date: Wed, 19 Jan 2000 12:10:32 +0900 Date: Wed, 19 Jan 2000 12:10:32 +0900
Message-ID: <000f01bf622a$bf423940$2801007e@tpf.co.jp> Message-ID: <000f01bf622a$bf423940$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal Importance: Normal
In-Reply-To: <200001190245.VAA13040@candle.pha.pa.us> In-Reply-To: <200001190245.VAA13040@candle.pha.pa.us>
Content-Length: 1509 Status: ORr
[ Charset ISO-8859-1 unsupported, converting... ]
> -----Original Message----- > -----Original Message-----
> From: Bruce Momjian [mailto:pgman@candle.pha.pa.us] > From: Bruce Momjian [mailto:pgman@candle.pha.pa.us]
> > > > > >
...@@ -471,20 +625,28 @@ Inoue@tpf.co.jp ...@@ -471,20 +625,28 @@ Inoue@tpf.co.jp
From dms@wplus.net Wed Jan 19 15:30:40 2000 From dms@wplus.net Wed Jan 19 15:30:40 2000
Received: from relay.wplus.net (relay.wplus.net [195.131.52.179])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id QAA25919
for <pgman@candle.pha.pa.us>; Wed, 19 Jan 2000 16:30:38 -0500 (EST)
X-Real-To: pgman@candle.pha.pa.us X-Real-To: pgman@candle.pha.pa.us
Received: from wplus.net (ppdms.dialup.wplus.net [195.131.52.71])
by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id AAA64218;
Thu, 20 Jan 2000 00:26:37 +0300 (MSK)
Message-ID: <38862C9D.C2151E4E@wplus.net> Message-ID: <38862C9D.C2151E4E@wplus.net>
Date: Thu, 20 Jan 2000 00:29:01 +0300 Date: Thu, 20 Jan 2000 00:29:01 +0300
From: Dmitry Samersoff <dms@wplus.net> From: Dmitry Samersoff <dms@wplus.net>
X-Mailer: Mozilla 4.61 [en] (WinNT; I) X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: ru,en X-Accept-Language: ru,en
MIME-Version: 1.0
To: Hiroshi Inoue <Inoue@tpf.co.jp> To: Hiroshi Inoue <Inoue@tpf.co.jp>
CC: Bruce Momjian <pgman@candle.pha.pa.us>, CC: Bruce Momjian <pgman@candle.pha.pa.us>,
pgsql-hackers <pgsql-hackers@postgreSQL.org> pgsql-hackers <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] Index recreation in vacuum Subject: Re: [HACKERS] Index recreation in vacuum
References: <000f01bf622a$bf423940$2801007e@tpf.co.jp> References: <000f01bf622a$bf423940$2801007e@tpf.co.jp>
Content-Length: 1204 Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Status: ORr
[ Charset KOI8-R unsupported, converting... ]
Hiroshi Inoue wrote: Hiroshi Inoue wrote:
> > > Yes,I believe so. It's necessary to keep consistency between heap > > > Yes,I believe so. It's necessary to keep consistency between heap
> > > table and indexes even in case of abort/crash. > > > table and indexes even in case of abort/crash.
...@@ -522,20 +684,28 @@ dms@wplus.net http://devnull.wplus.net ...@@ -522,20 +684,28 @@ dms@wplus.net http://devnull.wplus.net
* there will come soft rains * there will come soft rains
From dms@wplus.net Wed Jan 19 15:42:49 2000 From dms@wplus.net Wed Jan 19 15:42:49 2000
Received: from relay.wplus.net (relay.wplus.net [195.131.52.179])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id QAA26645
for <pgman@candle.pha.pa.us>; Wed, 19 Jan 2000 16:42:47 -0500 (EST)
X-Real-To: pgman@candle.pha.pa.us X-Real-To: pgman@candle.pha.pa.us
Received: from wplus.net (ppdms.dialup.wplus.net [195.131.52.71])
by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id AAA65264;
Thu, 20 Jan 2000 00:39:02 +0300 (MSK)
Message-ID: <38862F86.20328BD3@wplus.net> Message-ID: <38862F86.20328BD3@wplus.net>
Date: Thu, 20 Jan 2000 00:41:26 +0300 Date: Thu, 20 Jan 2000 00:41:26 +0300
From: Dmitry Samersoff <dms@wplus.net> From: Dmitry Samersoff <dms@wplus.net>
X-Mailer: Mozilla 4.61 [en] (WinNT; I) X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: ru,en X-Accept-Language: ru,en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us> To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: Hiroshi Inoue <Inoue@tpf.co.jp>, CC: Hiroshi Inoue <Inoue@tpf.co.jp>,
pgsql-hackers <pgsql-hackers@postgreSQL.org> pgsql-hackers <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] Index recreation in vacuum Subject: Re: [HACKERS] Index recreation in vacuum
References: <200001192132.QAA26048@candle.pha.pa.us> References: <200001192132.QAA26048@candle.pha.pa.us>
Content-Length: 431 Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Status: ORr
[ Charset KOI8-R unsupported, converting... ]
Bruce Momjian wrote: Bruce Momjian wrote:
> >
> We need two things: > We need two things:
...@@ -554,20 +724,98 @@ Dmitry Samersoff, DM\S ...@@ -554,20 +724,98 @@ Dmitry Samersoff, DM\S
dms@wplus.net http://devnull.wplus.net dms@wplus.net http://devnull.wplus.net
* there will come soft rains * there will come soft rains
From owner-pgsql-hackers@hub.org Thu Jan 20 23:51:34 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id AAA13891
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 00:51:31 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id AAA91784;
Fri, 21 Jan 2000 00:47:07 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 00:45:38 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id AAA91495
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 00:44:40 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id AAA91378
for <pgsql-hackers@postgreSQL.org>; Fri, 21 Jan 2000 00:44:04 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id AAA13592;
Fri, 21 Jan 2000 00:43:49 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001210543.AAA13592@candle.pha.pa.us>
Subject: [HACKERS] vacuum timings
To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 21 Jan 2000 00:43:49 -0500 (EST)
CC: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org
Status: OR
I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
400MB and index is 160MB.
With index on the single in4 column, I got:
78 seconds for a vacuum
121 seconds for vacuum after deleting a single row
662 seconds for vacuum after deleting the entire table
With no index, I got:
43 seconds for a vacuum
43 seconds for vacuum after deleting a single row
43 seconds for vacuum after deleting the entire table
I find this quite interesting.
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
************
From owner-pgsql-hackers@hub.org Fri Jan 21 00:34:56 2000 From owner-pgsql-hackers@hub.org Fri Jan 21 00:34:56 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA15559
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 01:34:55 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id BAA06108;
Fri, 21 Jan 2000 01:32:23 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 01:30:38 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id BAA03704
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 01:27:53 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sunpine.krs.ru (SunPine.krs.ru [195.161.16.37])
by hub.org (8.9.3/8.9.3) with ESMTP id BAA01710
for <pgsql-hackers@postgreSQL.org>; Fri, 21 Jan 2000 01:26:44 -0500 (EST)
(envelope-from vadim@krs.ru)
Received: from krs.ru (dune.krs.ru [195.161.16.38])
by sunpine.krs.ru (8.8.8/8.8.8) with ESMTP id NAA01685;
Fri, 21 Jan 2000 13:26:33 +0700 (KRS)
Message-ID: <3887FC19.80305217@krs.ru> Message-ID: <3887FC19.80305217@krs.ru>
Date: Fri, 21 Jan 2000 13:26:33 +0700 Date: Fri, 21 Jan 2000 13:26:33 +0700
From: Vadim Mikheev <vadim@krs.ru> From: Vadim Mikheev <vadim@krs.ru>
Organization: OJSC Rostelecom (Krasnoyarsk) Organization: OJSC Rostelecom (Krasnoyarsk)
X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-RELEASE i386) X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-RELEASE i386)
X-Accept-Language: ru, en X-Accept-Language: ru, en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us> To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: Tom Lane <tgl@sss.pgh.pa.us>, CC: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org> PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] vacuum timings Subject: Re: [HACKERS] vacuum timings
References: <200001210543.AAA13592@candle.pha.pa.us> References: <200001210543.AAA13592@candle.pha.pa.us>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 557 Status: OR
Bruce Momjian wrote: Bruce Momjian wrote:
> >
...@@ -591,6 +839,12 @@ Vadim ...@@ -591,6 +839,12 @@ Vadim
************ ************
From vadim@krs.ru Fri Jan 21 00:26:33 2000 From vadim@krs.ru Fri Jan 21 00:26:33 2000
Received: from sunpine.krs.ru (SunPine.krs.ru [195.161.16.37])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA15239
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 01:26:31 -0500 (EST)
Received: from krs.ru (dune.krs.ru [195.161.16.38])
by sunpine.krs.ru (8.8.8/8.8.8) with ESMTP id NAA01685;
Fri, 21 Jan 2000 13:26:33 +0700 (KRS)
Sender: root@sunpine.krs.ru Sender: root@sunpine.krs.ru
Message-ID: <3887FC19.80305217@krs.ru> Message-ID: <3887FC19.80305217@krs.ru>
Date: Fri, 21 Jan 2000 13:26:33 +0700 Date: Fri, 21 Jan 2000 13:26:33 +0700
...@@ -598,12 +852,15 @@ From: Vadim Mikheev <vadim@krs.ru> ...@@ -598,12 +852,15 @@ From: Vadim Mikheev <vadim@krs.ru>
Organization: OJSC Rostelecom (Krasnoyarsk) Organization: OJSC Rostelecom (Krasnoyarsk)
X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-RELEASE i386) X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 3.0-RELEASE i386)
X-Accept-Language: ru, en X-Accept-Language: ru, en
MIME-Version: 1.0
To: Bruce Momjian <pgman@candle.pha.pa.us> To: Bruce Momjian <pgman@candle.pha.pa.us>
CC: Tom Lane <tgl@sss.pgh.pa.us>, CC: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org> PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [HACKERS] vacuum timings Subject: Re: [HACKERS] vacuum timings
References: <200001210543.AAA13592@candle.pha.pa.us> References: <200001210543.AAA13592@candle.pha.pa.us>
Content-Length: 543 Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Status: ORr
Bruce Momjian wrote: Bruce Momjian wrote:
> >
...@@ -625,6 +882,12 @@ Wi/wo -F ? ...@@ -625,6 +882,12 @@ Wi/wo -F ?
Vadim Vadim
From Inoue@tpf.co.jp Fri Jan 21 00:40:35 2000 From Inoue@tpf.co.jp Fri Jan 21 00:40:35 2000
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id BAA15684
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 01:40:33 -0500 (EST)
Received: from cadzone ([126.0.1.40] (may be forged))
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id PAA04316; Fri, 21 Jan 2000 15:40:35 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp> From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Bruce Momjian" <pgman@candle.pha.pa.us> To: "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "PostgreSQL-development" <pgsql-hackers@postgreSQL.org>, Cc: "PostgreSQL-development" <pgsql-hackers@postgreSQL.org>,
...@@ -632,15 +895,18 @@ Cc: "PostgreSQL-development" <pgsql-hackers@postgreSQL.org>, ...@@ -632,15 +895,18 @@ Cc: "PostgreSQL-development" <pgsql-hackers@postgreSQL.org>,
Subject: RE: [HACKERS] vacuum timings Subject: RE: [HACKERS] vacuum timings
Date: Fri, 21 Jan 2000 15:46:15 +0900 Date: Fri, 21 Jan 2000 15:46:15 +0900
Message-ID: <000201bf63db$36cdae20$2801007e@tpf.co.jp> Message-ID: <000201bf63db$36cdae20$2801007e@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <200001210543.AAA13592@candle.pha.pa.us> In-Reply-To: <200001210543.AAA13592@candle.pha.pa.us>
Content-Length: 737 Status: OR
[ Charset ISO-8859-1 unsupported, converting... ]
> -----Original Message----- > -----Original Message-----
> From: owner-pgsql-hackers@postgreSQL.org > From: owner-pgsql-hackers@postgreSQL.org
> [mailto:owner-pgsql-hackers@postgreSQL.org]On Behalf Of Bruce Momjian > [mailto:owner-pgsql-hackers@postgreSQL.org]On Behalf Of Bruce Momjian
...@@ -669,6 +935,25 @@ Hiroshi Inoue ...@@ -669,6 +935,25 @@ Hiroshi Inoue
Inoue@tpf.co.jp Inoue@tpf.co.jp
From owner-pgsql-hackers@hub.org Fri Jan 21 12:00:49 2000 From owner-pgsql-hackers@hub.org Fri Jan 21 12:00:49 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id NAA13329
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 13:00:47 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id MAA96106;
Fri, 21 Jan 2000 12:55:34 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 12:53:53 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id MAA95775
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 12:52:54 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (root@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id MAA95720
for <pgsql-hackers@postgreSQL.org>; Fri, 21 Jan 2000 12:52:39 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id MAA12106;
Fri, 21 Jan 2000 12:51:53 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us> From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001211751.MAA12106@candle.pha.pa.us> Message-Id: <200001211751.MAA12106@candle.pha.pa.us>
Subject: [HACKERS] Re: vacuum timings Subject: [HACKERS] Re: vacuum timings
...@@ -678,8 +963,11 @@ To: Tom Lane <tgl@sss.pgh.pa.us> ...@@ -678,8 +963,11 @@ To: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 21 Jan 2000 12:51:53 -0500 (EST) Date: Fri, 21 Jan 2000 12:51:53 -0500 (EST)
CC: PostgreSQL-development <pgsql-hackers@postgreSQL.org> CC: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 1437 Status: OR
> Bruce Momjian <pgman@candle.pha.pa.us> writes: > Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is > > I loaded 10,000,000 rows into CREATE TABLE test (x INTEGER); Table is
...@@ -734,6 +1022,13 @@ What other conclusions can be made? ...@@ -734,6 +1022,13 @@ What other conclusions can be made?
************ ************
From scrappy@hub.org Fri Jan 21 12:45:38 2000 From scrappy@hub.org Fri Jan 21 12:45:38 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id NAA14380
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 13:45:29 -0500 (EST)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id OAA68289;
Fri, 21 Jan 2000 14:45:35 -0400 (AST)
(envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Fri, 21 Jan 2000 14:45:34 -0400 (AST) Date: Fri, 21 Jan 2000 14:45:34 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org> From: The Hermit Hacker <scrappy@hub.org>
...@@ -743,7 +1038,9 @@ cc: Tom Lane <tgl@sss.pgh.pa.us>, ...@@ -743,7 +1038,9 @@ cc: Tom Lane <tgl@sss.pgh.pa.us>,
Subject: Re: [HACKERS] Re: vacuum timings Subject: Re: [HACKERS] Re: vacuum timings
In-Reply-To: <200001211751.MAA12106@candle.pha.pa.us> In-Reply-To: <200001211751.MAA12106@candle.pha.pa.us>
Message-ID: <Pine.BSF.4.21.0001211443480.23487-100000@thelab.hub.org> Message-ID: <Pine.BSF.4.21.0001211443480.23487-100000@thelab.hub.org>
Content-Length: 787 MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: OR
On Fri, 21 Jan 2000, Bruce Momjian wrote: On Fri, 21 Jan 2000, Bruce Momjian wrote:
...@@ -778,6 +1075,12 @@ primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org ...@@ -778,6 +1075,12 @@ primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From tgl@sss.pgh.pa.us Fri Jan 21 13:06:35 2000 From tgl@sss.pgh.pa.us Fri Jan 21 13:06:35 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id OAA14618
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 14:06:33 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id OAA16501;
Fri, 21 Jan 2000 14:06:31 -0500 (EST)
To: Bruce Momjian <pgman@candle.pha.pa.us> To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org> cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: vacuum timings Subject: Re: vacuum timings
...@@ -788,7 +1091,7 @@ Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us> ...@@ -788,7 +1091,7 @@ Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
Date: Fri, 21 Jan 2000 14:06:31 -0500 Date: Fri, 21 Jan 2000 14:06:31 -0500
Message-ID: <16498.948481591@sss.pgh.pa.us> Message-ID: <16498.948481591@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us> From: Tom Lane <tgl@sss.pgh.pa.us>
Content-Length: 391 Status: OR
Bruce Momjian <pgman@candle.pha.pa.us> writes: Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Conclusions: > Conclusions:
...@@ -805,20 +1108,28 @@ fraction of the rows, rather than just the all or none cases. ...@@ -805,20 +1108,28 @@ fraction of the rows, rather than just the all or none cases.
regards, tom lane regards, tom lane
From dms@wplus.net Fri Jan 21 13:51:27 2000 From dms@wplus.net Fri Jan 21 13:51:27 2000
Received: from relay.wplus.net (relay.wplus.net [195.131.52.179])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id OAA15623
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 14:51:24 -0500 (EST)
X-Real-To: pgman@candle.pha.pa.us X-Real-To: pgman@candle.pha.pa.us
Received: from wplus.net (ppdms.dialup.wplus.net [195.131.52.71])
by relay.wplus.net (8.9.1/8.9.1/wplus.2) with ESMTP id WAA89451;
Fri, 21 Jan 2000 22:46:19 +0300 (MSK)
Message-ID: <3888B822.28F79A1F@wplus.net> Message-ID: <3888B822.28F79A1F@wplus.net>
Date: Fri, 21 Jan 2000 22:48:50 +0300 Date: Fri, 21 Jan 2000 22:48:50 +0300
From: Dmitry Samersoff <dms@wplus.net> From: Dmitry Samersoff <dms@wplus.net>
X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: ru,en X-Accept-Language: ru,en
MIME-Version: 1.0
To: Tom Lane <tgl@sss.pgh.pa.us> To: Tom Lane <tgl@sss.pgh.pa.us>
CC: Bruce Momjian <pgman@candle.pha.pa.us>, CC: Bruce Momjian <pgman@candle.pha.pa.us>,
PostgreSQL-development <pgsql-hackers@postgresql.org> PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] Re: vacuum timings Subject: Re: [HACKERS] Re: vacuum timings
References: <200001211751.MAA12106@candle.pha.pa.us> <16498.948481591@sss.pgh.pa.us> References: <200001211751.MAA12106@candle.pha.pa.us> <16498.948481591@sss.pgh.pa.us>
Content-Length: 585 Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit
Status: ORr
[ Charset KOI8-R unsupported, converting... ]
Tom Lane wrote: Tom Lane wrote:
> >
> Bruce Momjian <pgman@candle.pha.pa.us> writes: > Bruce Momjian <pgman@candle.pha.pa.us> writes:
...@@ -844,6 +1155,25 @@ dms@wplus.net http://devnull.wplus.net ...@@ -844,6 +1155,25 @@ dms@wplus.net http://devnull.wplus.net
* there will come soft rains * there will come soft rains
From owner-pgsql-hackers@hub.org Fri Jan 21 14:04:08 2000 From owner-pgsql-hackers@hub.org Fri Jan 21 14:04:08 2000
Received: from hub.org (hub.org [216.126.84.1])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id PAA16140
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 15:04:06 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id OAA34808;
Fri, 21 Jan 2000 14:59:30 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Fri, 21 Jan 2000 14:57:48 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id OAA34320
for pgsql-hackers-outgoing; Fri, 21 Jan 2000 14:56:50 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from candle.pha.pa.us (pgman@s5-03.ppp.op.net [209.152.195.67])
by hub.org (8.9.3/8.9.3) with ESMTP id OAA34255
for <pgsql-hackers@postgresql.org>; Fri, 21 Jan 2000 14:56:18 -0500 (EST)
(envelope-from pgman@candle.pha.pa.us)
Received: (from pgman@localhost)
by candle.pha.pa.us (8.9.0/8.9.0) id OAA15772;
Fri, 21 Jan 2000 14:54:22 -0500 (EST)
From: Bruce Momjian <pgman@candle.pha.pa.us> From: Bruce Momjian <pgman@candle.pha.pa.us>
Message-Id: <200001211954.OAA15772@candle.pha.pa.us> Message-Id: <200001211954.OAA15772@candle.pha.pa.us>
Subject: Re: [HACKERS] Re: vacuum timings Subject: Re: [HACKERS] Re: vacuum timings
...@@ -854,8 +1184,11 @@ Date: Fri, 21 Jan 2000 14:54:21 -0500 (EST) ...@@ -854,8 +1184,11 @@ Date: Fri, 21 Jan 2000 14:54:21 -0500 (EST)
CC: Tom Lane <tgl@sss.pgh.pa.us>, CC: Tom Lane <tgl@sss.pgh.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org> PostgreSQL-development <pgsql-hackers@postgreSQL.org>
X-Mailer: ELM [version 2.4ME+ PL66 (25)] X-Mailer: ELM [version 2.4ME+ PL66 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Sender: owner-pgsql-hackers@postgreSQL.org Sender: owner-pgsql-hackers@postgreSQL.org
Content-Length: 1093 Status: OR
[Charset koi8-r unsupported, filtering to ASCII...] [Charset koi8-r unsupported, filtering to ASCII...]
> Tom Lane wrote: > Tom Lane wrote:
...@@ -894,6 +1227,13 @@ toying with: ...@@ -894,6 +1227,13 @@ toying with:
************ ************
From scrappy@hub.org Fri Jan 21 14:12:16 2000 From scrappy@hub.org Fri Jan 21 14:12:16 2000
Received: from thelab.hub.org (nat200.60.mpoweredpc.net [142.177.200.60])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id PAA16521
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 15:12:13 -0500 (EST)
Received: from localhost (scrappy@localhost)
by thelab.hub.org (8.9.3/8.9.1) with ESMTP id QAA69039;
Fri, 21 Jan 2000 16:12:25 -0400 (AST)
(envelope-from scrappy@hub.org)
X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs X-Authentication-Warning: thelab.hub.org: scrappy owned process doing -bs
Date: Fri, 21 Jan 2000 16:12:25 -0400 (AST) Date: Fri, 21 Jan 2000 16:12:25 -0400 (AST)
From: The Hermit Hacker <scrappy@hub.org> From: The Hermit Hacker <scrappy@hub.org>
...@@ -903,7 +1243,9 @@ cc: Dmitry Samersoff <dms@wplus.net>, Tom Lane <tgl@sss.pgh.pa.us>, ...@@ -903,7 +1243,9 @@ cc: Dmitry Samersoff <dms@wplus.net>, Tom Lane <tgl@sss.pgh.pa.us>,
Subject: Re: [HACKERS] Re: vacuum timings Subject: Re: [HACKERS] Re: vacuum timings
In-Reply-To: <200001211954.OAA15772@candle.pha.pa.us> In-Reply-To: <200001211954.OAA15772@candle.pha.pa.us>
Message-ID: <Pine.BSF.4.21.0001211607080.23487-100000@thelab.hub.org> Message-ID: <Pine.BSF.4.21.0001211607080.23487-100000@thelab.hub.org>
Content-Length: 2345 MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Status: OR
On Fri, 21 Jan 2000, Bruce Momjian wrote: On Fri, 21 Jan 2000, Bruce Momjian wrote:
...@@ -965,6 +1307,12 @@ primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org ...@@ -965,6 +1307,12 @@ primary: scrappy@hub.org secondary: scrappy@{freebsd|postgresql}.org
From tgl@sss.pgh.pa.us Fri Jan 21 16:02:07 2000 From tgl@sss.pgh.pa.us Fri Jan 21 16:02:07 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id RAA20290
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 17:02:06 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id RAA09697;
Fri, 21 Jan 2000 17:02:06 -0500 (EST)
To: The Hermit Hacker <scrappy@hub.org> To: The Hermit Hacker <scrappy@hub.org>
cc: Bruce Momjian <pgman@candle.pha.pa.us>, cc: Bruce Momjian <pgman@candle.pha.pa.us>,
PostgreSQL-development <pgsql-hackers@postgreSQL.org> PostgreSQL-development <pgsql-hackers@postgreSQL.org>
...@@ -976,7 +1324,7 @@ Comments: In-reply-to The Hermit Hacker <scrappy@hub.org> ...@@ -976,7 +1324,7 @@ Comments: In-reply-to The Hermit Hacker <scrappy@hub.org>
Date: Fri, 21 Jan 2000 17:02:06 -0500 Date: Fri, 21 Jan 2000 17:02:06 -0500
Message-ID: <9694.948492126@sss.pgh.pa.us> Message-ID: <9694.948492126@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us> From: Tom Lane <tgl@sss.pgh.pa.us>
Content-Length: 1274 Status: OR
The Hermit Hacker <scrappy@hub.org> writes: The Hermit Hacker <scrappy@hub.org> writes:
>> lock table for less duration, or read lock >> lock table for less duration, or read lock
...@@ -1006,6 +1354,12 @@ recipe for deadlocks. Not sure if this can be solved. ...@@ -1006,6 +1354,12 @@ recipe for deadlocks. Not sure if this can be solved.
regards, tom lane regards, tom lane
From tgl@sss.pgh.pa.us Fri Jan 21 22:50:34 2000 From tgl@sss.pgh.pa.us Fri Jan 21 22:50:34 2000
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id XAA01657
for <pgman@candle.pha.pa.us>; Fri, 21 Jan 2000 23:50:28 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id XAA19681;
Fri, 21 Jan 2000 23:50:13 -0500 (EST)
To: Bruce Momjian <pgman@candle.pha.pa.us> To: Bruce Momjian <pgman@candle.pha.pa.us>
cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org> cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: vacuum timings Subject: Re: vacuum timings
...@@ -1016,7 +1370,7 @@ Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us> ...@@ -1016,7 +1370,7 @@ Comments: In-reply-to Bruce Momjian <pgman@candle.pha.pa.us>
Date: Fri, 21 Jan 2000 23:50:13 -0500 Date: Fri, 21 Jan 2000 23:50:13 -0500
Message-ID: <19678.948516613@sss.pgh.pa.us> Message-ID: <19678.948516613@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us> From: Tom Lane <tgl@sss.pgh.pa.us>
Content-Length: 1302 Status: ORr
Bruce Momjian <pgman@candle.pha.pa.us> writes: Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Conclusions: > Conclusions:
...@@ -1046,12 +1400,36 @@ into... ...@@ -1046,12 +1400,36 @@ into...
regards, tom lane regards, tom lane
From owner-pgsql-hackers@hub.org Sat Jan 22 02:31:03 2000 From owner-pgsql-hackers@hub.org Sat Jan 22 02:31:03 2000
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id DAA06743
for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 03:31:02 -0500 (EST)
Received: from hub.org (hub.org [216.126.84.1]) by renoir.op.net (o1/$Revision: 1.2 $) with ESMTP id DAA07529 for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 03:25:13 -0500 (EST)
Received: from localhost (majordom@localhost)
by hub.org (8.9.3/8.9.3) with SMTP id DAA31900;
Sat, 22 Jan 2000 03:19:53 -0500 (EST)
(envelope-from owner-pgsql-hackers)
Received: by hub.org (bulk_mailer v1.5); Sat, 22 Jan 2000 03:17:56 -0500
Received: (from majordom@localhost)
by hub.org (8.9.3/8.9.3) id DAA31715
for pgsql-hackers-outgoing; Sat, 22 Jan 2000 03:16:58 -0500 (EST)
(envelope-from owner-pgsql-hackers@postgreSQL.org)
Received: from sd.tpf.co.jp (sd.tpf.co.jp [210.161.239.34])
by hub.org (8.9.3/8.9.3) with ESMTP id DAA31647
for <pgsql-hackers@postgresql.org>; Sat, 22 Jan 2000 03:16:26 -0500 (EST)
(envelope-from Inoue@tpf.co.jp)
Received: from mcadnote1 (ppm114.noc.fukui.nsk.ne.jp [210.161.188.33])
by sd.tpf.co.jp (2.5 Build 2640 (Berkeley 8.8.6)/8.8.4) with SMTP
id RAA04754; Sat, 22 Jan 2000 17:14:43 +0900
From: "Hiroshi Inoue" <Inoue@tpf.co.jp> From: "Hiroshi Inoue" <Inoue@tpf.co.jp>
To: "Tom Lane" <tgl@sss.pgh.pa.us>, "Bruce Momjian" <pgman@candle.pha.pa.us> To: "Tom Lane" <tgl@sss.pgh.pa.us>, "Bruce Momjian" <pgman@candle.pha.pa.us>
Cc: "PostgreSQL-development" <pgsql-hackers@postgresql.org> Cc: "PostgreSQL-development" <pgsql-hackers@postgresql.org>
Subject: RE: [HACKERS] Re: vacuum timings Subject: RE: [HACKERS] Re: vacuum timings
Date: Sat, 22 Jan 2000 17:15:37 +0900 Date: Sat, 22 Jan 2000 17:15:37 +0900
Message-ID: <NDBBIJLOILGIKBGDINDFIEEACCAA.Inoue@tpf.co.jp> Message-ID: <NDBBIJLOILGIKBGDINDFIEEACCAA.Inoue@tpf.co.jp>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
...@@ -1059,11 +1437,48 @@ X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 ...@@ -1059,11 +1437,48 @@ X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
In-Reply-To: <16498.948481591@sss.pgh.pa.us> In-Reply-To: <16498.948481591@sss.pgh.pa.us>
Importance: Normal Importance: Normal
Sender: owner-pgsql-hackers@postgresql.org Sender: owner-pgsql-hackers@postgresql.org
Content-Length: 49 Status: OR
[ Charset iso-2022-jp unsupported, skipping... ] > -----Original Message-----
> From: owner-pgsql-hackers@postgresql.org
> [mailto:owner-pgsql-hackers@postgresql.org]On Behalf Of Tom Lane
>
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > Conclusions:
> > o indexes never get smaller
>
> Which we knew...
>
> > o drop/recreate index is slower than vacuum of indexes
>
> Quite a few people have reported finding the opposite in practice.
> You should probably try vacuuming after deleting or updating some
> fraction of the rows, rather than just the all or none cases.
>
Vacuum after delelting all rows isn't a worst case.
There's no moving in that case and vacuum doesn't need to call
index_insert() corresponding to the moving of heap tuples.
Vacuum after deleting half of rows may be one of the worst case.
In this case,index_delete() is called as many times as 'delete all'
case and expensive index_insert() is called for moved_in tuples.
Regards.
Hiroshi Inoue
Inoue@tpf.co.jp
************
From tgl@sss.pgh.pa.us Sat Jan 22 10:31:02 2000 From tgl@sss.pgh.pa.us Sat Jan 22 10:31:02 2000
Received: from renoir.op.net (root@renoir.op.net [207.29.195.4])
by candle.pha.pa.us (8.9.0/8.9.0) with ESMTP id LAA20882
for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 11:31:00 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by renoir.op.net (o1/$Revision: 1.2 $) with ESMTP id LAA26612 for <pgman@candle.pha.pa.us>; Sat, 22 Jan 2000 11:12:44 -0500 (EST)
Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1])
by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id LAA20569;
Sat, 22 Jan 2000 11:11:26 -0500 (EST)
To: "Hiroshi Inoue" <Inoue@tpf.co.jp> To: "Hiroshi Inoue" <Inoue@tpf.co.jp>
cc: "Bruce Momjian" <pgman@candle.pha.pa.us>, cc: "Bruce Momjian" <pgman@candle.pha.pa.us>,
"PostgreSQL-development" <pgsql-hackers@postgreSQL.org> "PostgreSQL-development" <pgsql-hackers@postgreSQL.org>
...@@ -1075,7 +1490,7 @@ Comments: In-reply-to "Hiroshi Inoue" <Inoue@tpf.co.jp> ...@@ -1075,7 +1490,7 @@ Comments: In-reply-to "Hiroshi Inoue" <Inoue@tpf.co.jp>
Date: Sat, 22 Jan 2000 11:11:25 -0500 Date: Sat, 22 Jan 2000 11:11:25 -0500
Message-ID: <20566.948557485@sss.pgh.pa.us> Message-ID: <20566.948557485@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us> From: Tom Lane <tgl@sss.pgh.pa.us>
Content-Length: 186 Status: OR
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes: "Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> Vacuum after deleting half of rows may be one of the worst case. > Vacuum after deleting half of rows may be one of the worst case.
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
Frequently Asked Questions (FAQ) for PostgreSQL Frequently Asked Questions (FAQ) for PostgreSQL
</H1> </H1>
<P> <P>
Last updated: Thu Jun 1 13:57:15 EDT 2000 Last updated: Fri Jun 2 11:32:13 EDT 2000
<P> <P>
Current maintainer: Bruce Momjian (<A Current maintainer: Bruce Momjian (<A
HREF="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR><P> HREF="mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR><P>
......
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.52 2000/06/02 01:25:20 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/release.sgml,v 1.53 2000/06/02 15:57:14 momjian Exp $
--> -->
<chapter id="release"> <chapter id="release">
...@@ -62,6 +62,8 @@ Copy pg_ident.conf.sample into /lib directory in install (Bruce) ...@@ -62,6 +62,8 @@ Copy pg_ident.conf.sample into /lib directory in install (Bruce)
Add SJIS UDC (NEC selection IBM kanji) support (Eiji Tokuya) Add SJIS UDC (NEC selection IBM kanji) support (Eiji Tokuya)
Fix too long syslog message (Tatsuo) Fix too long syslog message (Tatsuo)
Fix problem with quoted indexes that are too long (Tom) Fix problem with quoted indexes that are too long (Tom)
JDBC ResultSet.getTimestamp() fix (Gregory Krasnow & Floyd Marinescu)
ecpg changes (Michael)
</programlisting> </programlisting>
</para> </para>
</sect2> </sect2>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.15 2000/06/02 10:20:25 vadim Exp $ * $Header: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v 1.16 2000/06/02 15:57:16 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -746,11 +746,7 @@ XLogFileInit(uint32 log, uint32 seg) ...@@ -746,11 +746,7 @@ XLogFileInit(uint32 log, uint32 seg)
XLogFileName(path, log, seg); XLogFileName(path, log, seg);
unlink(path); unlink(path);
#ifndef __CYGWIN__ fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, S_IRUSR | S_IWUSR);
fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
#else
fd = BasicOpenFile(path, O_RDWR | O_CREAT | O_EXCL | O_BINARY, S_IRUSR | S_IWUSR);
#endif
if (fd < 0) if (fd < 0)
elog(STOP, "Open(logfile %u seg %u) failed: %d", elog(STOP, "Open(logfile %u seg %u) failed: %d",
logId, logSeg, errno); logId, logSeg, errno);
...@@ -782,11 +778,7 @@ XLogFileOpen(uint32 log, uint32 seg, bool econt) ...@@ -782,11 +778,7 @@ XLogFileOpen(uint32 log, uint32 seg, bool econt)
XLogFileName(path, log, seg); XLogFileName(path, log, seg);
#ifndef __CYGWIN__ fd = BasicOpenFile(path, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);
fd = BasicOpenFile(path, O_RDWR, S_IRUSR | S_IWUSR);
#else
fd = BasicOpenFile(path, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
#endif
if (fd < 0) if (fd < 0)
{ {
if (econt && errno == ENOENT) if (econt && errno == ENOENT)
...@@ -1096,11 +1088,7 @@ UpdateControlFile() ...@@ -1096,11 +1088,7 @@ UpdateControlFile()
{ {
int fd; int fd;
#ifndef __CYGWIN__ fd = BasicOpenFile(ControlFilePath, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);
fd = BasicOpenFile(ControlFilePath, O_RDWR, S_IRUSR | S_IWUSR);
#else
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
#endif
if (fd < 0) if (fd < 0)
elog(STOP, "Open(cntlfile) failed: %d", errno); elog(STOP, "Open(cntlfile) failed: %d", errno);
...@@ -1158,11 +1146,7 @@ BootStrapXLOG() ...@@ -1158,11 +1146,7 @@ BootStrapXLOG()
#endif #endif
#ifndef __CYGWIN__ fd = BasicOpenFile(ControlFilePath, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, S_IRUSR | S_IWUSR);
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
#else
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_CREAT | O_EXCL | O_BINARY, S_IRUSR | S_IWUSR);
#endif
if (fd < 0) if (fd < 0)
elog(STOP, "BootStrapXLOG failed to create control file (%s): %d", elog(STOP, "BootStrapXLOG failed to create control file (%s): %d",
ControlFilePath, errno); ControlFilePath, errno);
...@@ -1273,11 +1257,7 @@ StartupXLOG() ...@@ -1273,11 +1257,7 @@ StartupXLOG()
/* /*
* Open/read Control file * Open/read Control file
*/ */
#ifndef __CYGWIN__ fd = BasicOpenFile(ControlFilePath, O_RDWR | PG_BINARY, S_IRUSR | S_IWUSR);
fd = BasicOpenFile(ControlFilePath, O_RDWR, S_IRUSR | S_IWUSR);
#else
fd = BasicOpenFile(ControlFilePath, O_RDWR | O_BINARY, S_IRUSR | S_IWUSR);
#endif
if (fd < 0) if (fd < 0)
elog(STOP, "Open(\"%s\") failed: %d", ControlFilePath, errno); elog(STOP, "Open(\"%s\") failed: %d", ControlFilePath, errno);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.109 2000/05/30 04:25:00 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.110 2000/06/02 15:57:18 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -320,11 +320,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -320,11 +320,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
} }
else else
{ {
#ifndef __CYGWIN32__ fp = AllocateFile(filename, PG_BINARY_R);
fp = AllocateFile(filename, "r");
#else
fp = AllocateFile(filename, "rb");
#endif
if (fp == NULL) if (fp == NULL)
elog(ERROR, "COPY command, running in backend with " elog(ERROR, "COPY command, running in backend with "
"effective uid %d, could not open file '%s' for " "effective uid %d, could not open file '%s' for "
...@@ -355,12 +351,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe, ...@@ -355,12 +351,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
" COPY command."); " COPY command.");
oumask = umask((mode_t) 022); oumask = umask((mode_t) 022);
fp = AllocateFile(filename, PG_BINARY_W);
#ifndef __CYGWIN32__
fp = AllocateFile(filename, "w");
#else
fp = AllocateFile(filename, "wb");
#endif
umask(oumask); umask(oumask);
if (fp == NULL) if (fp == NULL)
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.44 2000/04/12 17:15:14 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.45 2000/06/02 15:57:20 momjian Exp $
* *
* NOTES * NOTES
* This should be moved to a more appropriate place. It is here * This should be moved to a more appropriate place. It is here
...@@ -342,11 +342,7 @@ lo_import(text *filename) ...@@ -342,11 +342,7 @@ lo_import(text *filename)
if (nbytes > FNAME_BUFSIZE) if (nbytes > FNAME_BUFSIZE)
nbytes = FNAME_BUFSIZE; nbytes = FNAME_BUFSIZE;
StrNCpy(fnamebuf, VARDATA(filename), nbytes); StrNCpy(fnamebuf, VARDATA(filename), nbytes);
#ifndef __CYGWIN32__ fd = PathNameOpenFile(fnamebuf, O_RDONLY | PG_BINARY, 0666);
fd = PathNameOpenFile(fnamebuf, O_RDONLY, 0666);
#else
fd = PathNameOpenFile(fnamebuf, O_RDONLY | O_BINARY, 0666);
#endif
if (fd < 0) if (fd < 0)
{ /* error */ { /* error */
elog(ERROR, "lo_import: can't open unix file \"%s\": %m", elog(ERROR, "lo_import: can't open unix file \"%s\": %m",
...@@ -427,11 +423,7 @@ lo_export(Oid lobjId, text *filename) ...@@ -427,11 +423,7 @@ lo_export(Oid lobjId, text *filename)
nbytes = FNAME_BUFSIZE; nbytes = FNAME_BUFSIZE;
StrNCpy(fnamebuf, VARDATA(filename), nbytes); StrNCpy(fnamebuf, VARDATA(filename), nbytes);
oumask = umask((mode_t) 0022); oumask = umask((mode_t) 0022);
#ifndef __CYGWIN32__ fd = PathNameOpenFile(fnamebuf, O_CREAT | O_WRONLY | O_TRUNC | PG_BINARY, 0666);
fd = PathNameOpenFile(fnamebuf, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#else
fd = PathNameOpenFile(fnamebuf, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666);
#endif
umask(oumask); umask(oumask);
if (fd < 0) if (fd < 0)
{ /* error */ { /* error */
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* Dec 17, 1997 - Todd A. Brandys * Dec 17, 1997 - Todd A. Brandys
* Orignal Version Completed. * Orignal Version Completed.
* *
* $Id: crypt.c,v 1.23 1999/07/17 20:17:01 momjian Exp $ * $Id: crypt.c,v 1.24 2000/06/02 15:57:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -73,11 +73,7 @@ crypt_openpwdfile() ...@@ -73,11 +73,7 @@ crypt_openpwdfile()
FILE *pwdfile; FILE *pwdfile;
filename = crypt_getpwdfilename(); filename = crypt_getpwdfilename();
#ifndef __CYGWIN32__ pwdfile = AllocateFile(filename, PG_BINARY_R);
pwdfile = AllocateFile(filename, "r");
#else
pwdfile = AllocateFile(filename, "rb");
#endif
return pwdfile; return pwdfile;
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* wherein you authenticate a user by seeing what IP address the system * wherein you authenticate a user by seeing what IP address the system
* says he comes from and possibly using ident). * says he comes from and possibly using ident).
* *
* $Id: hba.c,v 1.51 2000/04/12 17:15:14 momjian Exp $ * $Id: hba.c,v 1.52 2000/06/02 15:57:20 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -397,11 +397,7 @@ find_hba_entry(hbaPort *port, bool *hba_ok_p) ...@@ -397,11 +397,7 @@ find_hba_entry(hbaPort *port, bool *hba_ok_p)
old_conf_file = (char *) palloc(bufsize); old_conf_file = (char *) palloc(bufsize);
snprintf(old_conf_file, bufsize, "%s/%s", DataDir, OLD_CONF_FILE); snprintf(old_conf_file, bufsize, "%s/%s", DataDir, OLD_CONF_FILE);
#ifndef __CYGWIN32__ if ((fd = open(old_conf_file, O_RDONLY | PG_BINARY, 0)) != -1)
if ((fd = open(old_conf_file, O_RDONLY, 0)) != -1)
#else
if ((fd = open(old_conf_file, O_RDONLY | O_BINARY, 0)) != -1)
#endif
{ {
/* Old config file exists. Tell this guy he needs to upgrade. */ /* Old config file exists. Tell this guy he needs to upgrade. */
close(fd); close(fd);
...@@ -810,11 +806,7 @@ verify_against_usermap(const char *pguser, ...@@ -810,11 +806,7 @@ verify_against_usermap(const char *pguser,
map_file = (char *) palloc(bufsize); map_file = (char *) palloc(bufsize);
snprintf(map_file, bufsize, "%s/%s", DataDir, USERMAP_FILE); snprintf(map_file, bufsize, "%s/%s", DataDir, USERMAP_FILE);
#ifndef __CYGWIN32__ file = AllocateFile(map_file, PG_BINARY_R);
file = AllocateFile(map_file, "r");
#else
file = AllocateFile(map_file, "rb");
#endif
if (file == NULL) if (file == NULL)
{ {
/* The open of the map file failed. */ /* The open of the map file failed. */
...@@ -986,11 +978,7 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir) ...@@ -986,11 +978,7 @@ GetCharSetByHost(char *TableName, int host, const char *DataDir)
bufsize = (strlen(DataDir) + strlen(CHARSET_FILE) + 2) * sizeof(char); bufsize = (strlen(DataDir) + strlen(CHARSET_FILE) + 2) * sizeof(char);
map_file = (char *) palloc(bufsize); map_file = (char *) palloc(bufsize);
snprintf(map_file, bufsize, "%s/%s", DataDir, CHARSET_FILE); snprintf(map_file, bufsize, "%s/%s", DataDir, CHARSET_FILE);
#ifndef __CYGWIN32__ file = AllocateFile(map_file, PG_BINARY_R);
file = AllocateFile(map_file, "r");
#else
file = AllocateFile(map_file, "rb");
#endif
if (file == NULL) if (file == NULL)
return; return;
while (!eof) while (!eof)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: password.c,v 1.28 2000/01/26 05:56:29 momjian Exp $ * $Id: password.c,v 1.29 2000/06/02 15:57:21 momjian Exp $
* *
*/ */
...@@ -28,11 +28,7 @@ verify_password(char *auth_arg, char *user, char *password) ...@@ -28,11 +28,7 @@ verify_password(char *auth_arg, char *user, char *password)
strcat(pw_file_fullname, "/"); strcat(pw_file_fullname, "/");
strcat(pw_file_fullname, auth_arg); strcat(pw_file_fullname, auth_arg);
#ifndef __CYGWIN32__ pw_file = AllocateFile(pw_file_fullname, PG_BINARY_R);
pw_file = AllocateFile(pw_file_fullname, "r");
#else
pw_file = AllocateFile(pw_file_fullname, "rb");
#endif
if (!pw_file) if (!pw_file)
{ {
snprintf(PQerrormsg, PQERRORMSG_LENGTH, snprintf(PQerrormsg, PQERRORMSG_LENGTH,
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: pqcomm.c,v 1.93 2000/05/31 00:28:18 petere Exp $ * $Id: pqcomm.c,v 1.94 2000/06/02 15:57:21 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -234,11 +234,7 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP) ...@@ -234,11 +234,7 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP)
* can safely delete the file. * can safely delete the file.
*/ */
#ifdef HAVE_FCNTL_SETLK #ifdef HAVE_FCNTL_SETLK
#ifndef __CYGWIN32__ if ((lock_fd = open(sock_path, O_WRONLY | O_NONBLOCK | PG_BINARY, 0666)) >= 0)
if ((lock_fd = open(sock_path, O_WRONLY | O_NONBLOCK, 0666)) >= 0)
#else
if ((lock_fd = open(sock_path, O_WRONLY | O_NONBLOCK | O_BINARY, 0666)) >= 0)
#endif
{ {
struct flock lck; struct flock lck;
...@@ -287,11 +283,7 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP) ...@@ -287,11 +283,7 @@ StreamServerPort(char *hostName, unsigned short portName, int *fdP)
* lock_fd is left open to keep the lock. * lock_fd is left open to keep the lock.
*/ */
#ifdef HAVE_FCNTL_SETLK #ifdef HAVE_FCNTL_SETLK
#ifndef __CYGWIN32__ if ((lock_fd = open(sock_path, O_WRONLY | O_NONBLOCK | PG_BINARY, 0666)) >= 0)
if ((lock_fd = open(sock_path, O_WRONLY | O_NONBLOCK, 0666)) >= 0)
#else
if ((lock_fd = open(sock_path, O_WRONLY | O_NONBLOCK | O_BINARY, 0666)) >= 0)
#endif
{ {
struct flock lck; struct flock lck;
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.144 2000/05/31 00:28:25 petere Exp $ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.145 2000/06/02 15:57:22 momjian Exp $
* *
* NOTES * NOTES
* *
...@@ -327,11 +327,7 @@ checkDataDir(const char *DataDir, bool *DataDirOK) ...@@ -327,11 +327,7 @@ checkDataDir(const char *DataDir, bool *DataDirOK)
snprintf(path, sizeof(path), "%s%cbase%ctemplate1%cpg_class", snprintf(path, sizeof(path), "%s%cbase%ctemplate1%cpg_class",
DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR); DataDir, SEP_CHAR, SEP_CHAR, SEP_CHAR);
#ifndef __CYGWIN32__ fp = AllocateFile(path, PG_BINARY_R);
fp = AllocateFile(path, "r");
#else
fp = AllocateFile(path, "rb");
#endif
if (fp == NULL) if (fp == NULL)
{ {
fprintf(stderr, "%s does not find the database system. " fprintf(stderr, "%s does not find the database system. "
...@@ -433,7 +429,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -433,7 +429,7 @@ PostmasterMain(int argc, char *argv[])
*/ */
umask((mode_t) 0077); umask((mode_t) 0077);
ResetAllOptions(); ResetAllOptions();
if (!(hostName = getenv("PGHOST"))) if (!(hostName = getenv("PGHOST")))
{ {
...@@ -445,10 +441,10 @@ PostmasterMain(int argc, char *argv[]) ...@@ -445,10 +441,10 @@ PostmasterMain(int argc, char *argv[])
MyProcPid = getpid(); MyProcPid = getpid();
DataDir = getenv("PGDATA"); /* default value */ DataDir = getenv("PGDATA"); /* default value */
/* /*
* First we must scan for a -D argument to get the data dir. Then * First we must scan for a -D argument to get the data dir. Then
* read the config file. Finally, scan all the other arguments. * read the config file. Finally, scan all the other arguments.
* (Command line switches override config file.) * (Command line switches override config file.)
* *
* Note: The two lists of options must be exactly the same, even * Note: The two lists of options must be exactly the same, even
* though perhaps the first one would only have to be "D:" with * though perhaps the first one would only have to be "D:" with
...@@ -457,15 +453,15 @@ PostmasterMain(int argc, char *argv[]) ...@@ -457,15 +453,15 @@ PostmasterMain(int argc, char *argv[])
* to the local world view) which will result in some switches * to the local world view) which will result in some switches
* being associated with the wrong argument. Death and destruction * being associated with the wrong argument. Death and destruction
* will occur. * will occur.
*/ */
opterr = 1; opterr = 1;
while ((opt = getopt(nonblank_argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:")) != EOF) while ((opt = getopt(nonblank_argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:")) != EOF)
{ {
if (opt == 'D') if (opt == 'D')
DataDir = optarg; DataDir = optarg;
} }
optind = 1; /* start over */ optind = 1; /* start over */
checkDataDir(DataDir, &DataDirOK); /* issues error messages */ checkDataDir(DataDir, &DataDirOK); /* issues error messages */
if (!DataDirOK) if (!DataDirOK)
{ {
...@@ -473,7 +469,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -473,7 +469,7 @@ PostmasterMain(int argc, char *argv[])
exit(2); exit(2);
} }
ProcessConfigFile(PGC_POSTMASTER); ProcessConfigFile(PGC_POSTMASTER);
IgnoreSystemIndexes(false); IgnoreSystemIndexes(false);
while ((opt = getopt(nonblank_argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:")) != EOF) while ((opt = getopt(nonblank_argc, argv, "A:a:B:b:D:d:Film:MN:no:p:Ss-:")) != EOF)
...@@ -511,7 +507,7 @@ PostmasterMain(int argc, char *argv[]) ...@@ -511,7 +507,7 @@ PostmasterMain(int argc, char *argv[])
} }
break; break;
case 'D': case 'D':
/* already done above */ /* already done above */
break; break;
case 'd': case 'd':
...@@ -521,9 +517,9 @@ PostmasterMain(int argc, char *argv[]) ...@@ -521,9 +517,9 @@ PostmasterMain(int argc, char *argv[])
*/ */
DebugLvl = atoi(optarg); DebugLvl = atoi(optarg);
break; break;
case 'F': case 'F':
enableFsync = false; enableFsync = false;
break; break;
case 'i': case 'i':
NetServer = true; NetServer = true;
break; break;
...@@ -593,21 +589,21 @@ PostmasterMain(int argc, char *argv[]) ...@@ -593,21 +589,21 @@ PostmasterMain(int argc, char *argv[])
*/ */
SendStop = true; SendStop = true;
break; break;
case '-': case '-':
{ {
/* A little 'long argument' simulation */ /* A little 'long argument' simulation */
size_t equal_pos = strcspn(optarg, "="); size_t equal_pos = strcspn(optarg, "=");
char *cp; char *cp;
if (optarg[equal_pos] != '=') if (optarg[equal_pos] != '=')
elog(ERROR, "--%s requires argument", optarg); elog(ERROR, "--%s requires argument", optarg);
optarg[equal_pos] = '\0'; optarg[equal_pos] = '\0';
for(cp = optarg; *cp; cp++) for(cp = optarg; *cp; cp++)
if (*cp == '-') if (*cp == '-')
*cp = '_'; *cp = '_';
SetConfigOption(optarg, optarg + equal_pos + 1, PGC_POSTMASTER); SetConfigOption(optarg, optarg + equal_pos + 1, PGC_POSTMASTER);
break; break;
} }
default: default:
/* usage() never returns */ /* usage() never returns */
usage(progname); usage(progname);
...@@ -839,11 +835,7 @@ pmdaemonize(char *extraoptions) ...@@ -839,11 +835,7 @@ pmdaemonize(char *extraoptions)
exit(1); exit(1);
} }
#endif #endif
#ifndef __CYGWIN32__ i = open(NULL_DEV, O_RDWR | PG_BINARY);
i = open(NULL_DEV, O_RDWR);
#else
i = open(NULL_DEV, O_RDWR | O_BINARY);
#endif
dup2(i, 0); dup2(i, 0);
dup2(i, 1); dup2(i, 1);
dup2(i, 2); dup2(i, 2);
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.58 2000/06/02 03:58:32 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/file/fd.c,v 1.59 2000/06/02 15:57:24 momjian Exp $
* *
* NOTES: * NOTES:
* *
...@@ -701,14 +701,8 @@ OpenTemporaryFile(void) ...@@ -701,14 +701,8 @@ OpenTemporaryFile(void)
"pg_sorttemp%d.%ld", MyProcPid, tempFileCounter++); "pg_sorttemp%d.%ld", MyProcPid, tempFileCounter++);
/* Open the file */ /* Open the file */
#ifndef __CYGWIN32__
file = FileNameOpenFile(tempfilename, file = FileNameOpenFile(tempfilename,
O_RDWR | O_CREAT | O_TRUNC, 0600); O_RDWR | O_CREAT | O_TRUNC | PG_BINARY, 0600);
#else
file = FileNameOpenFile(tempfilename,
O_RDWR | O_CREAT | O_TRUNC | O_BINARY, 0600);
#endif
if (file <= 0) if (file <= 0)
elog(ERROR, "Failed to create temporary file %s", tempfilename); elog(ERROR, "Failed to create temporary file %s", tempfilename);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.69 2000/06/02 03:58:33 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.70 2000/06/02 15:57:26 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -131,11 +131,7 @@ mdcreate(Relation reln) ...@@ -131,11 +131,7 @@ mdcreate(Relation reln)
Assert(reln->rd_unlinked && reln->rd_fd < 0); Assert(reln->rd_unlinked && reln->rd_fd < 0);
path = relpath(RelationGetPhysicalRelationName(reln)); path = relpath(RelationGetPhysicalRelationName(reln));
#ifndef __CYGWIN32__ fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, 0600);
fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL, 0600);
#else
fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
#endif
/* /*
* During bootstrap processing, we skip that check, because pg_time, * During bootstrap processing, we skip that check, because pg_time,
...@@ -155,11 +151,7 @@ mdcreate(Relation reln) ...@@ -155,11 +151,7 @@ mdcreate(Relation reln)
reln->rd_rel->relkind == RELKIND_UNCATALOGED) reln->rd_rel->relkind == RELKIND_UNCATALOGED)
return -1; return -1;
#ifndef __CYGWIN32__ fd = FileNameOpenFile(path, O_RDWR | PG_BINARY, 0600);
fd = FileNameOpenFile(path, O_RDWR, 0600);
#else
fd = FileNameOpenFile(path, O_RDWR | O_BINARY, 0600);
#endif
if (fd < 0) if (fd < 0)
return -1; return -1;
if (!IsBootstrapProcessingMode()) if (!IsBootstrapProcessingMode())
...@@ -332,23 +324,12 @@ mdopen(Relation reln) ...@@ -332,23 +324,12 @@ mdopen(Relation reln)
Assert(reln->rd_fd < 0); Assert(reln->rd_fd < 0);
path = relpath(RelationGetPhysicalRelationName(reln)); path = relpath(RelationGetPhysicalRelationName(reln));
#ifndef __CYGWIN32__ fd = FileNameOpenFile(path, O_RDWR | PG_BINARY, 0600);
fd = FileNameOpenFile(path, O_RDWR, 0600);
#else
fd = FileNameOpenFile(path, O_RDWR | O_BINARY, 0600);
#endif
if (fd < 0) if (fd < 0)
{ {
/* in bootstrap mode, accept mdopen as substitute for mdcreate */ /* in bootstrap mode, accept mdopen as substitute for mdcreate */
if (IsBootstrapProcessingMode()) if (IsBootstrapProcessingMode())
{ fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | PG_BINARY, 0600);
#ifndef __CYGWIN32__
fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL, 0600);
#else
fd = FileNameOpenFile(path, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
#endif
}
if (fd < 0) if (fd < 0)
{ {
elog(NOTICE, "mdopen: couldn't open %s: %m", path); elog(NOTICE, "mdopen: couldn't open %s: %m", path);
...@@ -1004,11 +985,7 @@ _mdfd_openseg(Relation reln, int segno, int oflags) ...@@ -1004,11 +985,7 @@ _mdfd_openseg(Relation reln, int segno, int oflags)
fullpath = path; fullpath = path;
/* open the file */ /* open the file */
#ifndef __CYGWIN32__ fd = FileNameOpenFile(fullpath, O_RDWR | PG_BINARY | oflags, 0600);
fd = FileNameOpenFile(fullpath, O_RDWR | oflags, 0600);
#else
fd = FileNameOpenFile(fullpath, O_RDWR | O_BINARY | oflags, 0600);
#endif
pfree(fullpath); pfree(fullpath);
...@@ -1130,12 +1107,7 @@ _mdfd_blind_getseg(char *dbname, char *relname, Oid dbid, Oid relid, ...@@ -1130,12 +1107,7 @@ _mdfd_blind_getseg(char *dbname, char *relname, Oid dbid, Oid relid,
#endif #endif
/* call fd.c to allow other FDs to be closed if needed */ /* call fd.c to allow other FDs to be closed if needed */
#ifndef __CYGWIN32__ fd = BasicOpenFile(path, O_RDWR | PG_BINARY, 0600);
fd = BasicOpenFile(path, O_RDWR, 0600);
#else
fd = BasicOpenFile(path, O_RDWR | O_BINARY, 0600);
#endif
if (fd < 0) if (fd < 0)
elog(DEBUG, "_mdfd_blind_getseg: couldn't open %s: %m", path); elog(DEBUG, "_mdfd_blind_getseg: couldn't open %s: %m", path);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.54 2000/05/30 04:24:50 tgl Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.55 2000/06/02 15:57:28 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -549,11 +549,7 @@ _ReadLOArray(char *str, ...@@ -549,11 +549,7 @@ _ReadLOArray(char *str,
{ {
FILE *afd; FILE *afd;
#ifndef __CYGWIN32__ if ((afd = AllocateFile(accessfile, PG_BINARY_R)) == NULL)
if ((afd = AllocateFile(accessfile, "r")) == NULL)
#else
if ((afd = AllocateFile(accessfile, "r")) == NULL)
#endif
elog(ERROR, "unable to open access pattern file"); elog(ERROR, "unable to open access pattern file");
*chunkFlag = true; *chunkFlag = true;
retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes, retStr = _ChunkArray(*fd, afd, ndim, dim, baseSize, nbytes,
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.98 2000/05/30 00:49:54 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.99 2000/06/02 15:57:30 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -2122,11 +2122,7 @@ init_irels(void) ...@@ -2122,11 +2122,7 @@ init_irels(void)
int i; int i;
int relno; int relno;
#ifndef __CYGWIN32__ if ((fd = FileNameOpenFile(RELCACHE_INIT_FILENAME, O_RDONLY | PG_BINARY, 0600)) < 0)
if ((fd = FileNameOpenFile(RELCACHE_INIT_FILENAME, O_RDONLY, 0600)) < 0)
#else
if ((fd = FileNameOpenFile(RELCACHE_INIT_FILENAME, O_RDONLY | O_BINARY, 0600)) < 0)
#endif
{ {
write_irels(); write_irels();
return; return;
...@@ -2292,11 +2288,7 @@ write_irels(void) ...@@ -2292,11 +2288,7 @@ write_irels(void)
snprintf(finalfilename, sizeof(finalfilename), "%s%c%s", snprintf(finalfilename, sizeof(finalfilename), "%s%c%s",
DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME); DatabasePath, SEP_CHAR, RELCACHE_INIT_FILENAME);
#ifndef __CYGWIN32__ fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC | PG_BINARY, 0600);
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC, 0600);
#else
fd = PathNameOpenFile(tempfilename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0600);
#endif
if (fd < 0) if (fd < 0)
elog(FATAL, "cannot create init file %s", tempfilename); elog(FATAL, "cannot create init file %s", tempfilename);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.46 2000/05/02 08:13:08 ishii Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.47 2000/06/02 15:57:32 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -207,11 +207,7 @@ SetCharSet() ...@@ -207,11 +207,7 @@ SetCharSet()
map_file = (char *) malloc((strlen(DataDir) + map_file = (char *) malloc((strlen(DataDir) +
strlen(p) + 2) * sizeof(char)); strlen(p) + 2) * sizeof(char));
sprintf(map_file, "%s/%s", DataDir, p); sprintf(map_file, "%s/%s", DataDir, p);
#ifndef __CYGWIN32__ file = AllocateFile(map_file, PG_BINARY_R);
file = AllocateFile(map_file, "r");
#else
file = AllocateFile(map_file, "rb");
#endif
if (file == NULL) if (file == NULL)
return; return;
eof = false; eof = false;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.37 2000/04/12 17:16:07 momjian Exp $ * $Header: /cvsroot/pgsql/src/backend/utils/misc/Attic/database.c,v 1.38 2000/06/02 15:57:34 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -146,11 +146,7 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path) ...@@ -146,11 +146,7 @@ GetRawDatabaseInfo(const char *name, Oid *db_id, char *path)
dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabaseRelationName) + 2); dbfname = (char *) palloc(strlen(DataDir) + strlen(DatabaseRelationName) + 2);
sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabaseRelationName); sprintf(dbfname, "%s%c%s", DataDir, SEP_CHAR, DatabaseRelationName);
#ifndef __CYGWIN32__ if ((dbfd = open(dbfname, O_RDONLY | PG_BINARY, 0)) < 0)
if ((dbfd = open(dbfname, O_RDONLY, 0)) < 0)
#else
if ((dbfd = open(dbfname, O_RDONLY | O_BINARY, 0)) < 0)
#endif
elog(FATAL, "cannot open %s: %s", dbfname, strerror(errno)); elog(FATAL, "cannot open %s: %s", dbfname, strerror(errno));
pfree(dbfname); pfree(dbfname);
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.148 2000/05/28 20:34:52 tgl Exp $ * $Header: /cvsroot/pgsql/src/bin/pg_dump/pg_dump.c,v 1.149 2000/06/02 15:57:38 momjian Exp $
* *
* Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb * Modifications - 6/10/96 - dave@bensoft.com - version 1.13.dhb
* *
...@@ -760,11 +760,7 @@ main(int argc, char **argv) ...@@ -760,11 +760,7 @@ main(int argc, char **argv)
g_fout = stdout; g_fout = stdout;
else else
{ {
#ifndef __CYGWIN32__ g_fout = fopen(filename, PG_BINARY_W);
g_fout = fopen(filename, "w");
#else
g_fout = fopen(filename, "wb");
#endif
if (g_fout == NULL) if (g_fout == NULL)
{ {
fprintf(stderr, fprintf(stderr,
......
...@@ -54,11 +54,7 @@ read_pwd_file(char *filename) ...@@ -54,11 +54,7 @@ read_pwd_file(char *filename)
int i; int i;
try_again: try_again:
#ifndef __CYGWIN32__ fp = fopen(filename, PG_BINARY_R);
fp = fopen(filename, "r");
#else
fp = fopen(filename, "rb");
#endif
if (fp == NULL) if (fp == NULL)
{ {
if (errno == ENOENT) if (errno == ENOENT)
...@@ -70,11 +66,7 @@ try_again: ...@@ -70,11 +66,7 @@ try_again:
{ {
case 'y': case 'y':
case 'Y': case 'Y':
#ifndef __CYGWIN32__ fp = fopen(filename, PG_BINARY_W);
fp = fopen(filename, "w");
#else
fp = fopen(filename, "wb");
#endif
if (fp == NULL) if (fp == NULL)
{ {
perror(filename); perror(filename);
...@@ -192,11 +184,7 @@ link_again: ...@@ -192,11 +184,7 @@ link_again:
} }
/* open file */ /* open file */
#ifndef __CYGWIN32__ if ((fp = fopen(filename, PG_BINARY_W)) == NULL)
if ((fp = fopen(filename, "w")) == NULL)
#else
if ((fp = fopen(filename, "wb")) == NULL)
#endif
{ {
perror(filename); perror(filename);
exit(1); exit(1);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $Id: c.h,v 1.70 2000/05/28 17:56:09 tgl Exp $ * $Id: c.h,v 1.71 2000/06/02 15:57:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/fcntl.h>
#ifdef STDC_HEADERS #ifdef STDC_HEADERS
#include <stddef.h> #include <stddef.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -895,6 +896,16 @@ extern char *vararg_format(const char *fmt,...); ...@@ -895,6 +896,16 @@ extern char *vararg_format(const char *fmt,...);
* ---------------------------------------------------------------- * ----------------------------------------------------------------
*/ */
#ifndef __CYGWIN32__
#define PG_BINARY 0
#define PG_BINARY_R "rb"
#define PG_BINARY_W "wb"
#else
#define PG_BINARY O_BINARY
#define PG_BINARY_R "r"
#define PG_BINARY_W "w"
#endif
#ifdef FIXADE #ifdef FIXADE
#if defined(hpux) #if defined(hpux)
#include "port/hpux/fixade.h" /* for unaligned access fixup */ #include "port/hpux/fixade.h" /* for unaligned access fixup */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1995, Regents of the University of California * Portions Copyright (c) 1995, Regents of the University of California
* *
* $Id: postgres.h,v 1.39 2000/05/28 17:56:12 tgl Exp $ * $Id: postgres.h,v 1.40 2000/06/02 15:57:40 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -229,7 +229,6 @@ typedef uint32 CommandId; ...@@ -229,7 +229,6 @@ typedef uint32 CommandId;
*/ */
#ifdef CYR_RECODE #ifdef CYR_RECODE
extern void SetCharSet(); extern void SetCharSet();
#endif /* CYR_RECODE */ #endif /* CYR_RECODE */
#endif /* POSTGRES_H */ #endif /* POSTGRES_H */
...@@ -66,11 +66,7 @@ main(int argc, char *const argv[]) ...@@ -66,11 +66,7 @@ main(int argc, char *const argv[])
switch (c) switch (c)
{ {
case 'o': case 'o':
#ifndef __CYGWIN32__ yyout = fopen(optarg, PG_BINARY_W);
yyout = fopen(optarg, "w");
#else
yyout = fopen(optarg, "wb");
#endif
if (yyout == NULL) if (yyout == NULL)
perror(optarg); perror(optarg);
else else
...@@ -147,11 +143,7 @@ main(int argc, char *const argv[]) ...@@ -147,11 +143,7 @@ main(int argc, char *const argv[])
ptr2ext[1] = 'c'; ptr2ext[1] = 'c';
ptr2ext[2] = '\0'; ptr2ext[2] = '\0';
#ifndef __CYGWIN32__ yyout = fopen(output_filename, PG_BINARY_W);
yyout = fopen(output_filename, "w");
#else
yyout = fopen(output_filename, "wb");
#endif
if (yyout == NULL) if (yyout == NULL)
{ {
perror(output_filename); perror(output_filename);
...@@ -161,11 +153,7 @@ main(int argc, char *const argv[]) ...@@ -161,11 +153,7 @@ main(int argc, char *const argv[])
} }
} }
#ifndef __CYGWIN32__ yyin = fopen(input_filename, PG_BINARY_R);
yyin = fopen(input_filename, "r");
#else
yyin = fopen(input_filename, "rb");
#endif
if (yyin == NULL) if (yyin == NULL)
perror(argv[fnr]); perror(argv[fnr]);
else else
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.29 2000/04/12 17:17:15 momjian Exp $ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-lobj.c,v 1.30 2000/06/02 15:57:42 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -391,11 +391,7 @@ lo_import(PGconn *conn, const char *filename) ...@@ -391,11 +391,7 @@ lo_import(PGconn *conn, const char *filename)
/* /*
* open the file to be read in * open the file to be read in
*/ */
#ifndef __CYGWIN32__ fd = open(filename, O_RDONLY | PG_BINARY, 0666);
fd = open(filename, O_RDONLY, 0666);
#else
fd = open(filename, O_RDONLY | O_BINARY, 0666);
#endif
if (fd < 0) if (fd < 0)
{ /* error */ { /* error */
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
...@@ -474,11 +470,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename) ...@@ -474,11 +470,7 @@ lo_export(PGconn *conn, Oid lobjId, const char *filename)
/* /*
* open the file to be written to * open the file to be written to
*/ */
#ifndef __CYGWIN32__ fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC | PG_BINARY, 0666);
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC, 0666);
#else
fd = open(filename, O_CREAT | O_WRONLY | O_TRUNC | O_BINARY, 0666);
#endif
if (fd < 0) if (fd < 0)
{ /* error */ { /* error */
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
...@@ -544,7 +536,7 @@ lo_initialize(PGconn *conn) ...@@ -544,7 +536,7 @@ lo_initialize(PGconn *conn)
* ---------------- * ----------------
*/ */
res = PQexec(conn, "select proname, oid from pg_proc \ res = PQexec(conn, "select proname, oid from pg_proc \
where proname = 'lo_open' \ where proname = 'lo_open' \
or proname = 'lo_close' \ or proname = 'lo_close' \
or proname = 'lo_creat' \ or proname = 'lo_creat' \
or proname = 'lo_unlink' \ or proname = 'lo_unlink' \
......
...@@ -59,7 +59,7 @@ GetPrivateProfileString(char *theSection, /* section name */ ...@@ -59,7 +59,7 @@ GetPrivateProfileString(char *theSection, /* section name */
BOOL aSectionFound = FALSE; BOOL aSectionFound = FALSE;
BOOL aKeyFound = FALSE; BOOL aKeyFound = FALSE;
int j = 0; int j = 0;
j = strlen(theIniFileName) + 1; j = strlen(theIniFileName) + 1;
ptr = (char*)getpwuid(getuid()); /* get user info */ ptr = (char*)getpwuid(getuid()); /* get user info */
...@@ -92,21 +92,13 @@ GetPrivateProfileString(char *theSection, /* section name */ ...@@ -92,21 +92,13 @@ GetPrivateProfileString(char *theSection, /* section name */
/* This code makes it so that a file in the users home dir /* This code makes it so that a file in the users home dir
* overrides a the "default" file as passed in * overrides a the "default" file as passed in
*/ */
#ifndef __CYGWIN32__ aFile = (FILE*)(buf ? fopen(buf, PG_BINARY_R) : NULL);
aFile = (FILE*)(buf ? fopen(buf, "r") : NULL);
#else
aFile = (FILE*)(buf ? fopen(buf, "rb") : NULL);
#endif
if(!aFile) { if(!aFile) {
sprintf(buf,"%s",theIniFileName); sprintf(buf,"%s",theIniFileName);
#ifndef __CYGWIN32__ aFile = (FILE*)(buf ? fopen(buf, PG_BINARY_R) : NULL);
aFile = (FILE*)(buf ? fopen(buf, "r") : NULL);
#else
aFile = (FILE*)(buf ? fopen(buf, "rb") : NULL);
#endif
} }
aLength = (theDefault == NULL) ? 0 : strlen(theDefault); aLength = (theDefault == NULL) ? 0 : strlen(theDefault);
if(theReturnBufferLength == 0 || theReturnBuffer == NULL) if(theReturnBufferLength == 0 || theReturnBuffer == NULL)
...@@ -145,7 +137,7 @@ GetPrivateProfileString(char *theSection, /* section name */ ...@@ -145,7 +137,7 @@ GetPrivateProfileString(char *theSection, /* section name */
case ';': /* comment line */ case ';': /* comment line */
continue; continue;
break; break;
case '[': /* section marker */ case '[': /* section marker */
if( (aString = strchr(aLine, ']')) ) if( (aString = strchr(aLine, ']')) )
...@@ -173,7 +165,7 @@ GetPrivateProfileString(char *theSection, /* section name */ ...@@ -173,7 +165,7 @@ GetPrivateProfileString(char *theSection, /* section name */
if(aSectionFound) if(aSectionFound)
{ {
/* try to match requested key */ /* try to match requested key */
if( (aString = aValue = strchr(aLine, '=')) ) if( (aString = aValue = strchr(aLine, '=')) )
{ {
*aValue = '\0'; *aValue = '\0';
...@@ -220,7 +212,7 @@ GetPrivateProfileString(char *theSection, /* section name */ ...@@ -220,7 +212,7 @@ GetPrivateProfileString(char *theSection, /* section name */
/* remove trailing blanks from aValue if any */ /* remove trailing blanks from aValue if any */
aString = aValue + aLength - 1; aString = aValue + aLength - 1;
while(--aString > aValue && *aString == ' ') while(--aString > aValue && *aString == ' ')
{ {
*aString = '\0'; *aString = '\0';
...@@ -333,9 +325,9 @@ WritePrivateProfileString(char *theSection, /* section name */ ...@@ -333,9 +325,9 @@ WritePrivateProfileString(char *theSection, /* section name */
BOOL aSectionFound = FALSE; BOOL aSectionFound = FALSE;
BOOL keyFound = FALSE; BOOL keyFound = FALSE;
int j = 0; int j = 0;
/* If this isn't correct processing we'll change it later */ /* If this isn't correct processing we'll change it later */
if(theSection == NULL || theKey == NULL || theBuffer == NULL || if(theSection == NULL || theKey == NULL || theBuffer == NULL ||
theIniFileName == NULL) return 0; theIniFileName == NULL) return 0;
aLength = strlen(theBuffer); aLength = strlen(theBuffer);
...@@ -380,7 +372,7 @@ WritePrivateProfileString(char *theSection, /* section name */ ...@@ -380,7 +372,7 @@ WritePrivateProfileString(char *theSection, /* section name */
if(!aFile) return 0; if(!aFile) return 0;
} }
aLength = strlen(theBuffer); aLength = strlen(theBuffer);
/* We have to search for theKey, because if it already */ /* We have to search for theKey, because if it already */
...@@ -401,7 +393,7 @@ WritePrivateProfileString(char *theSection, /* section name */ ...@@ -401,7 +393,7 @@ WritePrivateProfileString(char *theSection, /* section name */
case ';': /* comment line */ case ';': /* comment line */
continue; continue;
break; break;
case '[': /* section marker */ case '[': /* section marker */
if( (aString = strchr(aLine, ']')) ) if( (aString = strchr(aLine, ']')) )
...@@ -425,7 +417,7 @@ WritePrivateProfileString(char *theSection, /* section name */ ...@@ -425,7 +417,7 @@ WritePrivateProfileString(char *theSection, /* section name */
if(aSectionFound) if(aSectionFound)
{ {
/* try to match requested key */ /* try to match requested key */
if( (aString = aValue = strchr(aLine, '=')) ) if( (aString = aValue = strchr(aLine, '=')) )
{ {
*aValue = '\0'; *aValue = '\0';
......
...@@ -68,11 +68,7 @@ mylog(char * fmt, ...) ...@@ -68,11 +68,7 @@ mylog(char * fmt, ...)
if (! LOGFP) { if (! LOGFP) {
generate_filename(MYLOGDIR,MYLOGFILE,filebuf); generate_filename(MYLOGDIR,MYLOGFILE,filebuf);
#ifndef __CYGWIN32__ LOGFP = fopen(filebuf, PG_BINARY_W);
LOGFP = fopen(filebuf, "w");
#else
LOGFP = fopen(filebuf, "wb");
#endif
globals.mylogFP = LOGFP; globals.mylogFP = LOGFP;
setbuf(LOGFP, NULL); setbuf(LOGFP, NULL);
} }
...@@ -100,11 +96,7 @@ qlog(char * fmt, ...) ...@@ -100,11 +96,7 @@ qlog(char * fmt, ...)
if (! LOGFP) { if (! LOGFP) {
generate_filename(QLOGDIR,QLOGFILE,filebuf); generate_filename(QLOGDIR,QLOGFILE,filebuf);
#ifndef __CYGWIN32__ LOGFP = fopen(filebuf, PG_BINARY_W);
LOGFP = fopen(filebuf, "w");
#else
LOGFP = fopen(filebuf, "wb");
#endif
globals.qlogFP = LOGFP; globals.qlogFP = LOGFP;
setbuf(LOGFP, NULL); setbuf(LOGFP, NULL);
} }
...@@ -136,9 +128,9 @@ qlog(char * fmt, ...) ...@@ -136,9 +128,9 @@ qlog(char * fmt, ...)
#include <sql.h> #include <sql.h>
#endif #endif
/* returns STRCPY_FAIL, STRCPY_TRUNCATED, or #bytes copied (not including null term) */ /* returns STRCPY_FAIL, STRCPY_TRUNCATED, or #bytes copied (not including null term) */
int int
my_strcpy(char *dst, int dst_len, char *src, int src_len) my_strcpy(char *dst, int dst_len, char *src, int src_len)
{ {
if (dst_len <= 0) if (dst_len <= 0)
...@@ -146,7 +138,7 @@ my_strcpy(char *dst, int dst_len, char *src, int src_len) ...@@ -146,7 +138,7 @@ my_strcpy(char *dst, int dst_len, char *src, int src_len)
if (src_len == SQL_NULL_DATA) { if (src_len == SQL_NULL_DATA) {
dst[0] = '\0'; dst[0] = '\0';
return STRCPY_NULL; return STRCPY_NULL;
} }
else if (src_len == SQL_NTS) else if (src_len == SQL_NTS)
src_len = strlen(src); src_len = strlen(src);
...@@ -154,12 +146,12 @@ my_strcpy(char *dst, int dst_len, char *src, int src_len) ...@@ -154,12 +146,12 @@ my_strcpy(char *dst, int dst_len, char *src, int src_len)
if (src_len <= 0) if (src_len <= 0)
return STRCPY_FAIL; return STRCPY_FAIL;
else { else {
if (src_len < dst_len) { if (src_len < dst_len) {
memcpy(dst, src, src_len); memcpy(dst, src, src_len);
dst[src_len] = '\0'; dst[src_len] = '\0';
} }
else { else {
memcpy(dst, src, dst_len-1); memcpy(dst, src, dst_len-1);
dst[dst_len-1] = '\0'; /* truncated */ dst[dst_len-1] = '\0'; /* truncated */
return STRCPY_TRUNCATED; return STRCPY_TRUNCATED;
...@@ -184,7 +176,7 @@ int i; ...@@ -184,7 +176,7 @@ int i;
if (len == SQL_NULL_DATA) { if (len == SQL_NULL_DATA) {
dst[0] = '\0'; dst[0] = '\0';
return NULL; return NULL;
} }
else if (len == SQL_NTS) else if (len == SQL_NTS)
len = strlen(src) + 1; len = strlen(src) + 1;
...@@ -208,7 +200,7 @@ make_string(char *s, int len, char *buf) ...@@ -208,7 +200,7 @@ make_string(char *s, int len, char *buf)
int length; int length;
char *str; char *str;
if(s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) { if(s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) {
length = (len > 0) ? len : strlen(s); length = (len > 0) ? len : strlen(s);
if (buf) { if (buf) {
...@@ -216,11 +208,11 @@ char *str; ...@@ -216,11 +208,11 @@ char *str;
return buf; return buf;
} }
str = malloc(length + 1); str = malloc(length + 1);
if ( ! str) if ( ! str)
return NULL; return NULL;
strncpy_null(str, s, length+1); strncpy_null(str, s, length+1);
return str; return str;
} }
...@@ -235,7 +227,7 @@ char * ...@@ -235,7 +227,7 @@ char *
my_strcat(char *buf, char *fmt, char *s, int len) my_strcat(char *buf, char *fmt, char *s, int len)
{ {
if (s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) { if (s && (len > 0 || (len == SQL_NTS && strlen(s) > 0))) {
int length = (len > 0) ? len : strlen(s); int length = (len > 0) ? len : strlen(s);
int pos = strlen(buf); int pos = strlen(buf);
...@@ -248,14 +240,14 @@ my_strcat(char *buf, char *fmt, char *s, int len) ...@@ -248,14 +240,14 @@ my_strcat(char *buf, char *fmt, char *s, int len)
void remove_newlines(char *string) void remove_newlines(char *string)
{ {
unsigned int i; unsigned int i;
for(i=0; i < strlen(string); i++) { for(i=0; i < strlen(string); i++) {
if((string[i] == '\n') || if((string[i] == '\n') ||
(string[i] == '\r')) { (string[i] == '\r')) {
string[i] = ' '; string[i] = ' ';
} }
} }
} }
char * char *
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.15 2000/04/12 17:17:22 momjian Exp $ * $Header: /cvsroot/pgsql/src/utils/Attic/version.c,v 1.16 2000/06/02 15:57:44 momjian Exp $
* *
* STANDALONE CODE - do not use error routines as this code is not linked * STANDALONE CODE - do not use error routines as this code is not linked
* with any... * with any...
...@@ -67,11 +67,7 @@ ValidatePgVersion(const char *path, char **reason_p) ...@@ -67,11 +67,7 @@ ValidatePgVersion(const char *path, char **reason_p)
sprintf(myversion, "%s.%s\n", PG_RELEASE, PG_VERSION); sprintf(myversion, "%s.%s\n", PG_RELEASE, PG_VERSION);
#ifndef __CYGWIN32__ if ((fd = open(full_path, O_RDONLY | PG_BINARY, 0)) == -1)
if ((fd = open(full_path, O_RDONLY, 0)) == -1)
#else
if ((fd = open(full_path, O_RDONLY | O_BINARY, 0)) == -1)
#endif
{ {
*reason_p = malloc(100 + strlen(full_path)); *reason_p = malloc(100 + strlen(full_path));
sprintf(*reason_p, "File '%s' does not exist or no read permission.", full_path); sprintf(*reason_p, "File '%s' does not exist or no read permission.", full_path);
...@@ -125,11 +121,7 @@ SetPgVersion(const char *path, char **reason_p) ...@@ -125,11 +121,7 @@ SetPgVersion(const char *path, char **reason_p)
sprintf(version, "%s.%s\n", PG_RELEASE, PG_VERSION); sprintf(version, "%s.%s\n", PG_RELEASE, PG_VERSION);
#ifndef __CYGWIN32__ fd = open(full_path, O_WRONLY | O_CREAT | O_EXCL | PG_BINARY, 0666);
fd = open(full_path, O_WRONLY | O_CREAT | O_EXCL, 0666);
#else
fd = open(full_path, O_WRONLY | O_CREAT | O_EXCL | O_BINARY, 0666);
#endif
if (fd < 0) if (fd < 0)
{ {
*reason_p = malloc(100 + strlen(full_path)); *reason_p = malloc(100 + strlen(full_path));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment