Thread: PostgreSQL overall design

PostgreSQL overall design

From
Gnanavel S
Date:
Hi All,

  Can anyone please tell/point  me where I can get the postgresql system layout (I've an interest to contribute). I would also like to know the files involved for performing each task ( for eg when doing a select operation what is exactly happening in postgres along with the files).

  I was wandering inside the source for a while and I couldn't get a start point to go with.

 Need a clarification in copydir.c file of src/port directory,  In the following snippet the destination directory is created first then the source directory is read. Suppose if I don't have permission to read the source, even then the destination directory would be created.
I just want to know whether there is any reason for doing so?

        if (mkdir(todir, S_IRUSR | S_IWUSR | S_IXUSR) != 0)
                ereport(ERROR,
                                (errcode_for_file_access(),
                                 errmsg("could not create directory \"%s\": %m", todir)));

        xldir = AllocateDir(fromdir);
        if (xldir == NULL)
                ereport(ERROR,
                                (errcode_for_file_access(),
                                 errmsg("could not open directory \"%s\": %m", fromdir)));



--
with thanks & regards,
S.Gnanavel
Satyam Computer Services Ltd.

Re: PostgreSQL overall design

From
Andrew Dunstan
Date:
[ -performance removed ]

Gnanavel S wrote:

>
>  Need a clarification in copydir.c file of src/port directory,  In the 
> following snippet the destination directory is created first then the 
> source directory is read. Suppose if I don't have permission to read 
> the source, even then the destination directory would be created.
> I just want to know whether there is any reason for doing so?
>
>        


Under what circumstances do you imagine this will happen, since the 
postmaster user owns all the files and directories?

cheers

andrew


Re: [PERFORM] PostgreSQL overall design

From
Bruce Momjian
Date:
Have you read the developers FAQ?

---------------------------------------------------------------------------

Gnanavel S wrote:
> Hi All,
>
> Can anyone please tell/point me where I can get the postgresql system layout
> (I've an interest to contribute). I would also like to know the files
> involved for performing each task ( for eg when doing a select operation
> what is exactly happening in postgres along with the files).
>
> I was wandering inside the source for a while and I couldn't get a start
> point to go with.
>
> Need a clarification in copydir.c file of src/port directory, In the
> following snippet the destination directory is created first then the source
> directory is read. Suppose if I don't have permission to read the source,
> even then the destination directory would be created.
> I just want to know whether there is any reason for doing so?
>
> if (mkdir(todir, S_IRUSR | S_IWUSR | S_IXUSR) != 0)
> ereport(ERROR,
> (errcode_for_file_access(),
> errmsg("could not create directory \"%s\": %m", todir)));
>
> xldir = AllocateDir(fromdir);
> if (xldir == NULL)
> ereport(ERROR,
> (errcode_for_file_access(),
> errmsg("could not open directory \"%s\": %m", fromdir)));
>
>
>
> --
> with thanks & regards,
> S.Gnanavel
> Satyam Computer Services Ltd.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

Re: PostgreSQL overall design

From
Gnanavel S
Date:


On 9/27/05, Andrew Dunstan <andrew@dunslane.net> wrote:

[ -performance removed ]

Gnanavel S wrote:

>
>  Need a clarification in copydir.c file of src/port directory,  In the
> following snippet the destination directory is created first then the
> source directory is read. Suppose if I don't have permission to read
> the source, even then the destination directory would be created.
> I just want to know whether there is any reason for doing so?
>
>


Under what circumstances do you imagine this will happen, since the
postmaster user owns all the files and directories?

Understood. But can you explain why it is done in that way as what I said seems to be standard way of doing it (correct me if I'm wrong).



--
with regards,
S.Gnanavel

Re: [PERFORM] PostgreSQL overall design

From
Gnanavel S
Date:


On 9/27/05, Bruce Momjian <pgman@candle.pha.pa.us> wrote:

Have you read the developers FAQ?

Thanks Bruce. I'm going through that.

---------------------------------------------------------------------------

Gnanavel S wrote:
> Hi All,
>
> Can anyone please tell/point me where I can get the postgresql system layout
> (I've an interest to contribute). I would also like to know the files
> involved for performing each task ( for eg when doing a select operation
> what is exactly happening in postgres along with the files).
>
> I was wandering inside the source for a while and I couldn't get a start
> point to go with.
>
> Need a clarification in copydir.c file of src/port directory, In the
> following snippet the destination directory is created first then the source
> directory is read. Suppose if I don't have permission to read the source,
> even then the destination directory would be created.
> I just want to know whether there is any reason for doing so?
>
> if (mkdir(todir, S_IRUSR | S_IWUSR | S_IXUSR) != 0)
> ereport(ERROR,
> (errcode_for_file_access(),
> errmsg("could not create directory \"%s\": %m", todir)));
>
> xldir = AllocateDir(fromdir);
> if (xldir == NULL)
> ereport(ERROR,
> (errcode_for_file_access(),
> errmsg("could not open directory \"%s\": %m", fromdir)));
>
>
>
> --
> with thanks & regards,
> S.Gnanavel
> Satyam Computer Services Ltd.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073



--
with regards,
S.Gnanavel