Re: Removal of temp tables - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Removal of temp tables
Date
Msg-id 200106141818.f5EIITw15401@candle.pha.pa.us
Whole thread Raw
In response to Re: Removal of temp tables  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> > What else do we do with them except sorts?
>
> Hash joins.  Materialize nodes.  Not to mention that sorting is used for
> things that aren't obviously sorts (SELECT count(distinct foo), for
> example).

Oh, I didn't know that.  OK.

> > Seems
> > pid_ was a good file name because they are always based on pid in
> > storage/file/fd.c.  The directory could be called simply 'tempfile' with
> > no pg_.  How is that?
>
> You had that to begin with, and I changed it because I thought it was a
> bad idea.  The directory name and file name should both make perfectly
> clear that the files are temp files belonging to Postgres.  For example,
> it would be unsafe to make pg_tempfiles be a symlink pointing to a temp
> directory shared with other apps if there was any risk of temp file name
> collisions.  (Not sure you'd do that anyway, because of security issues,
> but let's not foreclose it with a poor choice of file names.)  A purely
> numeric file name for temp files is a particularly bad idea because it
> looks too much like our numeric names for table data files.  Don't
> eliminate a hypothetical confusion factor between relnames and filenames
> (which are never seen in the same context anyway) by introducing one
> between filenames and other filenames.

OK, I see, you think it could share a directory with another app.  Now I
see why you used pg_temp.

>
> If you don't like pg_temp here, maybe post_temp?  pgsql_temp?

OK, pgsql_temp works for me.  Everytime I see pg_ I think system table.
I will use pgsql_temp for directory and file names.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Please review: Authentication after fork
Next
From: Bruce Momjian
Date:
Subject: Re: use GUC for cmdline