Re: BUG #15460: Error while creating index or constraint

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: paul(dot)vanderlinden(at)mapcreator(dot)eu, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: BUG #15460: Error while creating index or constraint
Date: 2018-11-13 09:49:26
Message-ID: CAEepm=0aB+Tvvs=zQH_=GPjgfxzPNzGK78wPhFtdWwW+d1Nvcw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Nov 13, 2018 at 10:13 PM Thomas Munro
<thomas(dot)munro(at)enterprisedb(dot)com> wrote:
> On Tue, Oct 30, 2018 at 4:15 AM Peter Geoghegan <pg(at)bowt(dot)ie> wrote:
> > > ERROR: could not determine size of temporary file "0"
>
> filesize = BufFileSize(file);
> if (filesize < 0)
> ereport(ERROR,
> (errcode_for_file_access(),
> errmsg("could not determine
> size of temporary file \"%s\"", filename)));
>
> Ahh. I think we may be overflowing a 32 bit off_t on this platform.

I think using pgoff_t would fix the problem on Windows, but on other
systems where it maps directly to off_t it might also be 32 bits, so
I'm not entirely sure what pgoff_t is for. Perhaps we should just use
int64 directly for this? Like in the attached draft patch. I don't
have a Windows system to test it on. A separate bug report that came
in today[1] has repro steps that could be used to validate it.

[1] https://www.postgresql.org/message-id/flat/CAHDGBJP_GsESbTt4P3FZA8kMUKuYxjg57XHF7NRBoKnR%3DCAR-g%40mail.gmail.com

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Use-64-bit-type-for-BufFileSize.patch application/octet-stream 2.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Etsuro Fujita 2018-11-13 09:50:58 Re: BUG #15449: file_fdw using program cause exit code error when using LIMIT
Previous Message Peter Eisentraut 2018-11-13 09:45:36 Re: BUG #15356: Inconsistent documentation about CREATE TYPE