Thread: ERROR while creating new user - could not open relation mapping file global/pg_filenode.map

Hi All,

I am trying to use postgresql with a Rails app, and I am having an issue
creating a new user/password.
I get the following message:
createuser: could not connect to database postgres: FATAL: could not open
relation mapping file "global/pg_filenode.map": No such file or directory

I believe I might of accidentally deleted this file and after sudo
uninstalling Postgres with Brew and re-installing I still cannot get it back
or to work.

I am using the latest version of Postgres and I'm on Mac OS X 10.10.4

Any idea on how I can fix this issue? Thanks so much in advance.

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 11/23/2015 11:38 AM, Sribeiro wrote:
> Hi All,
>
> I am trying to use postgresql with a Rails app, and I am having an issue
> creating a new user/password.
> I get the following message:
> createuser: could not connect to database postgres: FATAL: could not open
> relation mapping file "global/pg_filenode.map": No such file or directory
>
> I believe I might of accidentally deleted this file and after sudo
> uninstalling Postgres with Brew and re-installing I still cannot get it back
> or to work.

So as part of the uninstall/install did you do initdb over again or are 
you reusing the previous cluster directory?

Have you looked in the $PGDATA/global directory to see if 
pg_filenode.map is indeed there or not?

Do you have a backup of the database(s)?


>
> I am using the latest version of Postgres and I'm on Mac OS X 10.10.4
>
> Any idea on how I can fix this issue? Thanks so much in advance.
>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



On 11/23/2015 11:38 AM, Sribeiro wrote:
> Hi All,
>
> I am trying to use postgresql with a Rails app, and I am having an issue
> creating a new user/password.
> I get the following message:
> createuser: could not connect to database postgres: FATAL: could not open
> relation mapping file "global/pg_filenode.map": No such file or directory
>
> I believe I might of accidentally deleted this file and after sudo
> uninstalling Postgres with Brew and re-installing I still cannot get it back
> or to work.
>
> I am using the latest version of Postgres and I'm on Mac OS X 10.10.4
>
> Any idea on how I can fix this issue? Thanks so much in advance.

Hmm, this does not look promising:


http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/cache/relmapper.c;h=c151b92dfc3d795aaa9455022512a2ba3479d7eb;hb=HEAD

"/* * The map file is critical data: we have no automatic method for 
recovering * from loss or corruption of it. ..."

>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Hi Adrian,

I did, but i got a message saying - no data directory specified.

As far as database, i didn't get that far into it...never got to initialize
a database.

Where would I find this directory - $PGDATA
I looked in the - usr/local/var/postgres - but no file in there.

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874855.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



Dang it.... So what would be my next move address the issue?

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874860.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



Anyone has any idea what i need to do fix this issue?

In terms of data in the file, unless there was data in it placed by Apple or
some other application, I did not have any information I needed in it. But
from the research i've done about this file, I cannot seem to determine if
it's a critical file for Apple/Mac OS X or if it's important for
applications i work on.

Anyone have any additional information about the file?

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874934.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



Sribeiro <info@simetriastudio.com> writes:
> Anyone has any idea what i need to do fix this issue?

You don't have an up-to-date backup, eh?

You might be able to fix this by doing a fresh initdb (targeting some
other location for the data directory, of course, but being careful
to use the exact same Postgres version) and then copying the
global/pg_filenode.map file out of that data directory and into your
broken one.  This would only work if you've never done a VACUUM FULL on
any of the shared catalogs in the existing data directory, so it's far
from guaranteed to work; but it's worth a try.

BTW, before any sort of manual data-directory surgery like this, it
would be a wise idea to make a backup copy of the entire data directory
file tree, e.g. with tar.  That way you can at least get back to where
you were if you break it worse.  Though I'm afraid you might end up
having to write off this installation as a learning experience :-(
        regards, tom lane



Tom Lane wrote:
> Sribeiro <info@simetriastudio.com> writes:
> > Anyone has any idea what i need to do fix this issue?
> 
> You don't have an up-to-date backup, eh?
> 
> You might be able to fix this by doing a fresh initdb (targeting some
> other location for the data directory, of course, but being careful
> to use the exact same Postgres version) and then copying the
> global/pg_filenode.map file out of that data directory and into your
> broken one.  This would only work if you've never done a VACUUM FULL on
> any of the shared catalogs in the existing data directory, so it's far
> from guaranteed to work; but it's worth a try.

It's relatively easy to identify the files corresponding to each
catalog, even when they have been mapped; just pg_filedump the files
until you find ones that match the expected number of attributes, and
disambiguate based on which attributes have HEAP_VARWIDTH and such.
Then you just need to cp the right files to the default names using the
default map created in the freshly initdb'd cluster.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> Tom Lane wrote:
>> You might be able to fix this by doing a fresh initdb (targeting some
>> other location for the data directory, of course, but being careful
>> to use the exact same Postgres version) and then copying the
>> global/pg_filenode.map file out of that data directory and into your
>> broken one.  This would only work if you've never done a VACUUM FULL on
>> any of the shared catalogs in the existing data directory, so it's far
>> from guaranteed to work; but it's worth a try.

> It's relatively easy to identify the files corresponding to each
> catalog, even when they have been mapped; just pg_filedump the files
> until you find ones that match the expected number of attributes, and
> disambiguate based on which attributes have HEAP_VARWIDTH and such.
> Then you just need to cp the right files to the default names using the
> default map created in the freshly initdb'd cluster.

Yeah, but that's getting past the level of what I'd expect an average user
to be able to do.  If the data is valuable enough to justify that level of
effort, it'd be wise to hire a data recovery expert (such as yourself ;-)).

I'm suspicious that the "accidental damage" extended to more than
just global/pg_filenode.map.  If it was really something more like
"find -name '*.map' | xargs rm", it would definitely be into professional
recovery territory, IMO.
        regards, tom lane



On 11/23/2015 12:23 PM, Sribeiro wrote:
> Hi Adrian,
>
> I did, but i got a message saying - no data directory specified.
>
> As far as database, i didn't get that far into it...never got to initialize
> a database.
>
> Where would I find this directory - $PGDATA
> I looked in the - usr/local/var/postgres - but no file in there.

I think we are going to have to back up here and get a description of 
your install procedure.

1) What exactly did you try to install, Postgres version and package(s)?  a) Source for packages?

2) What steps did you take during the install?  a) Install packages?  b) Create database cluster?

3) On your original install did you ever actually connect to Postgres?

4) How did you uninstall the original install?

>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874855.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Thanks Tom.

I didn't/don't have anything I personally need for Postgres. I was merely
trying it out and using it with a new rails application. I'm ok starting
over, like I said, I didn't have any db created yet.

What would I need to do to completely start fresh with Postgres?

Is that file, in particular, needed by Mac OS X? I think I read somewhere
that Postgres is also used by X-Code. Not sure if this is accurate or not.

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874973.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



Adrian Klaver-4 wrote
> I think we are going to have to back up here and get a description of 
> your install procedure.
> 
> 1) What exactly did you try to install, Postgres version and package(s)?
>    a) Source for packages?
> 
> 2) What steps did you take during the install?
>    a) Install packages?
>    b) Create database cluster?
> 
> 3) On your original install did you ever actually connect to Postgres?
> 
> 4) How did you uninstall the original install?
> 
> Adrian Klaver

> adrian.klaver@

> 

First off thanks Gents.

1) I installed Postgres using Homebrew and the version is - postgres
(PostgreSQL) 9.4.4
Not sure what else gets installed with Postgres when installed with Brew

2) After installing postgres, i just followed the instructions prompted by
brew/postgres in the terminal - I can't remember what they were, but I
believe it was 3 steps (one was for Postgres auto start)

3) Not sure... I tried creating a user and password and that's when things
started. I looked online on how to create a user and followed some
suggestions, but to no avail, so I thought my installation was buggy, so I
tried to start from scratch and that's at that point that I delete the
folder "postgres" inside usr/local/var/

4) I uninstalled using brew and then deleted the above mentioned folder. 

I'm not trying to contradict what you guys are saying (you guys obviously
know better than me), but in my mind it doesn't make sense why it can't be
started from scratch if I did not have any users or databases. Again, I'm
just trying to understand why this file is so needed/critical.

Thanks again guys.

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874984.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 11/24/2015 02:42 PM, Sribeiro wrote:
> Adrian Klaver-4 wrote
>> I think we are going to have to back up here and get a description of
>> your install procedure.
>>
>> 1) What exactly did you try to install, Postgres version and package(s)?
>>     a) Source for packages?
>>
>> 2) What steps did you take during the install?
>>     a) Install packages?
>>     b) Create database cluster?
>>
>> 3) On your original install did you ever actually connect to Postgres?
>>
>> 4) How did you uninstall the original install?
>>
>> Adrian Klaver
>
>> adrian.klaver@
>
>>
>
> First off thanks Gents.
>
> 1) I installed Postgres using Homebrew and the version is - postgres
> (PostgreSQL) 9.4.4
> Not sure what else gets installed with Postgres when installed with Brew
>
> 2) After installing postgres, i just followed the instructions prompted by
> brew/postgres in the terminal - I can't remember what they were, but I
> believe it was 3 steps (one was for Postgres auto start)
>
> 3) Not sure... I tried creating a user and password and that's when things
> started. I looked online on how to create a user and followed some
> suggestions, but to no avail, so I thought my installation was buggy, so I
> tried to start from scratch and that's at that point that I delete the
> folder "postgres" inside usr/local/var/
>
> 4) I uninstalled using brew and then deleted the above mentioned folder.
>
> I'm not trying to contradict what you guys are saying (you guys obviously
> know better than me), but in my mind it doesn't make sense why it can't be
> started from scratch if I did not have any users or databases. Again, I'm
> just trying to understand why this file is so needed/critical.

I do not use OS X so I am at a disadvantage here. I can you point you at 
this:

http://www.russbrooks.com/2010/11/25/install-postgresql-9-on-os-x

Does it look like what you did?

>
> Thanks again guys.
>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5874984.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Similar....

This is closer to what i did -
https://launchschool.com/blog/how-to-install-postgresql-on-a-mac

How critical is this file? Is it a case that without it, I can't do anything
with postgres, or is it a critical file in general for OS X? I know you said
you didn't have much experience with OS X, but I'm hoping someone else could
explain to me.

Thank you.



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875916.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 11:41 AM, Sribeiro wrote:
> Similar....
>
> This is closer to what i did -
> https://launchschool.com/blog/how-to-install-postgresql-on-a-mac
>
> How critical is this file? Is it a case that without it, I can't do anything

Without the file Postgres will not start, as you have found out, so yes 
it is critical.

> with postgres, or is it a critical file in general for OS X? I know you said
> you didn't have much experience with OS X, but I'm hoping someone else could
> explain to me.

At this point I have forgotten where we left of, so:

What is the directory listing for /usr/local/var/postgres?

If there is a Postgres data directory under the above directory, is 
pg_filenode.map in ~<data_dir>/global?

>
> Thank you.
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875916.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



This is what that directory looks like - http://postimg.org/image/olhb2zra9/

I can't find anywhere on my system (doing a search) the .map file.

Thank you for clarifying the importance of that file.
Since I didn't have any important information on it, can I start from
scratch, and thus creating a new .map file?

Sergio





--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875948.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 01:06 PM, Sribeiro wrote:
> This is what that directory looks like - http://postimg.org/image/olhb2zra9/
>
> I can't find anywhere on my system (doing a search) the .map file.
>
> Thank you for clarifying the importance of that file.
> Since I didn't have any important information on it, can I start from
> scratch, and thus creating a new .map file?

Yes, that would be the easiest solution. The initdb step, of the link 
you posted previously, will throw an error and not complete if there are 
any files under /usr/local/var/postgres. So make sure you clean this out 
first.

>
> Sergio
>
>
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875948.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Hi Adrian,

So, i made sure to copy the postgres directory then deleted the main one as
to not conflict with a fresh install. 

Once I got to the section in the instructions I used that says to run the -
rake db:create:all
I get the following error:
[mystore (master)]$ rake db:create:all
FATAL:  could not open relation mapping file "global/pg_filenode.map": No
such file or directory

BUT, if I look in the newest postgres/global directory, the pg_filenode.map
is in there.

Any thoughts

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875964.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 01:44 PM, Sribeiro wrote:
> Hi Adrian,
>
> So, i made sure to copy the postgres directory then deleted the main one as
> to not conflict with a fresh install.
>
> Once I got to the section in the instructions I used that says to run the -
> rake db:create:all
> I get the following error:
> [mystore (master)]$ rake db:create:all
> FATAL:  could not open relation mapping file "global/pg_filenode.map": No
> such file or directory
>
> BUT, if I look in the newest postgres/global directory, the pg_filenode.map
> is in there.

Best guess is the user you are running the above as does not have 
permissions on the directory.

>
> Any thoughts
>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875964.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Thank you!

Ugh, I am the only user in this machine. Do you know any commands to findout
who has permissions to the directory?

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875970.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 01:56 PM, Sribeiro wrote:
> Thank you!
>
> Ugh, I am the only user in this machine. Do you know any commands to findout
> who has permissions to the directory?

Open a terminal and in the directory:

ls -al

>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875970.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



The only user is "Serge"

This is what i get:
drwx------  42 Serge  admin   1428 Dec  2 16:33 .
drwx------  24 Serge  admin    816 Dec  2 16:43 ..
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12145
-rw-------   1 Serge  admin  24576 Dec  2 16:33 12145_fsm
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12145_vm
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12147
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12148
-rw-------   1 Serge  admin      0 Dec  2 16:33 12279
-rw-------   1 Serge  admin      0 Dec  2 16:33 12281
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12283
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12284
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12285
-rw-------   1 Serge  admin  24576 Dec  2 16:33 12285_fsm
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12285_vm
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12287
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12288
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12289
-rw-------   1 Serge  admin  24576 Dec  2 16:33 12289_fsm
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12289_vm
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12291
-rw-------   1 Serge  admin      0 Dec  2 16:33 12292
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12294
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12295
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12296
-rw-------   1 Serge  admin  24576 Dec  2 16:33 12296_fsm
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12296_vm
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12298
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12299
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12300
-rw-------   1 Serge  admin  24576 Dec  2 16:33 12300_fsm
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12300_vm
-rw-------   1 Serge  admin      0 Dec  2 16:33 12302
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12304
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12305
-rw-------   1 Serge  admin      0 Dec  2 16:33 12350
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12352
-rw-------   1 Serge  admin   8192 Dec  2 16:33 12399
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12401
-rw-------   1 Serge  admin  16384 Dec  2 16:33 12402
-rw-------   1 Serge  admin   8192 Dec  2 16:33 pg_control
-rw-------   1 Serge  admin    512 Dec  2 16:33 pg_filenode.map
-rw-------   1 Serge  admin  12828 Dec  2 16:33 pg_internal.init



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875982.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 02:36 PM, Sribeiro wrote:
>
> The only user is "Serge"

What are using for the user name in your Rake config/database.yml?

Can you use that user to connect to the database cluster using psql?:

psql -d postgres -U <user_name>

>
> This is what i get:
> drwx------  42 Serge  admin   1428 Dec  2 16:33 .
> drwx------  24 Serge  admin    816 Dec  2 16:43 ..
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12145
> -rw-------   1 Serge  admin  24576 Dec  2 16:33 12145_fsm
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12145_vm
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12147
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12148
> -rw-------   1 Serge  admin      0 Dec  2 16:33 12279
> -rw-------   1 Serge  admin      0 Dec  2 16:33 12281
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12283
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12284
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12285
> -rw-------   1 Serge  admin  24576 Dec  2 16:33 12285_fsm
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12285_vm
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12287
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12288
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12289
> -rw-------   1 Serge  admin  24576 Dec  2 16:33 12289_fsm
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12289_vm
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12291
> -rw-------   1 Serge  admin      0 Dec  2 16:33 12292
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12294
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12295
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12296
> -rw-------   1 Serge  admin  24576 Dec  2 16:33 12296_fsm
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12296_vm
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12298
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12299
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12300
> -rw-------   1 Serge  admin  24576 Dec  2 16:33 12300_fsm
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12300_vm
> -rw-------   1 Serge  admin      0 Dec  2 16:33 12302
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12304
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12305
> -rw-------   1 Serge  admin      0 Dec  2 16:33 12350
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12352
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 12399
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12401
> -rw-------   1 Serge  admin  16384 Dec  2 16:33 12402
> -rw-------   1 Serge  admin   8192 Dec  2 16:33 pg_control
> -rw-------   1 Serge  admin    512 Dec  2 16:33 pg_filenode.map
> -rw-------   1 Serge  admin  12828 Dec  2 16:33 pg_internal.init
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875982.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



On the database.yml I am using Serge as username
And password is blank. I tried running the rake db:create:all command with
it as nill and also with the computer password - same result as before:
FATAL:  could not open relation mapping file "global/pg_filenode.map": No
such file or directory

ALSO

Couldn't create database for {"adapter"=>"postgresql",
"encoding"=>"unicode", "pool"=>5, "database"=>"mystore_production",
"username"=>"mystore", "password"=>nil}

As far as psql -d postgres -U Serge I get:
psql: FATAL:  could not open relation mapping file "global/pg_filenode.map":
No such file or directory



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875988.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 03:08 PM, Sribeiro wrote:
> On the database.yml I am using Serge as username
> And password is blank. I tried running the rake db:create:all command with
> it as nill and also with the computer password - same result as before:
> FATAL:  could not open relation mapping file "global/pg_filenode.map": No
> such file or directory
>
> ALSO
>
> Couldn't create database for {"adapter"=>"postgresql",
> "encoding"=>"unicode", "pool"=>5, "database"=>"mystore_production",
> "username"=>"mystore", "password"=>nil}
>
> As far as psql -d postgres -U Serge I get:
> psql: FATAL:  could not open relation mapping file "global/pg_filenode.map":
> No such file or directory

Hmm, from a terminal again:

env | grep PG

>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875988.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Nothing... just a new blank prompt



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875994.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 03:34 PM, Sribeiro wrote:
> Nothing... just a new blank prompt
From terminal:

ps ax| grep post

Also, do you remember the exact steps you took when you re-installed 
this last time?

>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875994.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



I used these steps up until the second to last step (rake db:create:all) and
hit this brick wall -
https://launchschool.com/blog/how-to-install-postgresql-on-a-mac

Ok this command worked...I get:
297   ??  S      0:00.21 /usr/local/opt/postgresql/bin/postgres -D
/usr/local/var/postgres -r /usr/local/var/postgres/server.log 340   ??  Ss     0:00.01 postgres: checkpointer process
341  ??  Ss     0:00.36 postgres: writer process 342   ??  Ss     0:00.34 postgres: wal writer process 343   ??  Ss
0:05.33postgres: autovacuum launcher process 344   ??  Ss     0:00.71 postgres: stats collector process
 
23112 s000  S+     0:00.00 grep post



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875998.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 03:56 PM, Sribeiro wrote:
> I used these steps up until the second to last step (rake db:create:all) and
> hit this brick wall -
> https://launchschool.com/blog/how-to-install-postgresql-on-a-mac
>
> Ok this command worked...I get:
> 297   ??  S      0:00.21 /usr/local/opt/postgresql/bin/postgres -D
> /usr/local/var/postgres -r /usr/local/var/postgres/server.log
>    340   ??  Ss     0:00.01 postgres: checkpointer process
>    341   ??  Ss     0:00.36 postgres: writer process
>    342   ??  Ss     0:00.34 postgres: wal writer process
>    343   ??  Ss     0:05.33 postgres: autovacuum launcher process
>    344   ??  Ss     0:00.71 postgres: stats collector process
> 23112 s000  S+     0:00.00 grep post
>

So what happens from a terminal when you do?:

/usr/local/opt/postgresql/bin/psql -d postgres -U Serg

Also what is in /usr/local/var/postgres/server.log?

>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5875998.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Running that command I get: 
psql: FATAL:  could not open relation mapping file "global/pg_filenode.map":
No such file or directory

And inside the server.log is an immense amount of logs over 4000.
But, i didn't find the server.log inside the /usr/local/var/postgres/
directory, I found it inside the old copy of the postgres folder i made a
copy when i did the fresh install today - when we first started speaking.

Should it be moved to the /usr/local/var/postgres/ directory? I guess it
didn't create a new server.log when I did the fresh install





--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876007.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 04:34 PM, Sribeiro wrote:
> Running that command I get:
> psql: FATAL:  could not open relation mapping file "global/pg_filenode.map":
> No such file or directory
>
> And inside the server.log is an immense amount of logs over 4000.
> But, i didn't find the server.log inside the /usr/local/var/postgres/
> directory, I found it inside the old copy of the postgres folder i made a

And that copy is where?
From terminal:

env | grep PATH

> copy when i did the fresh install today - when we first started speaking.
>
> Should it be moved to the /usr/local/var/postgres/ directory? I guess it
> didn't create a new server.log when I did the fresh install

No moving of stuff until we figure out what is going on.
>
>
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876007.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



The copy of the old postgres directory (that includes the server.log file),
is on my desktop.

After running your command i get:
PATH=/Users/Serge/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Also I found this post just now. Not sure if there's anything helpful in
there.
https://github.com/PostgresApp/PostgresApp/issues/96



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876012.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 04:51 PM, Sribeiro wrote:
> The copy of the old postgres directory (that includes the server.log file),
> is on my desktop.

So where you found the server.log files, what are the timestamps on the 
most recent?


>
> After running your command i get:
> PATH=/Users/Serge/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
>
> Also I found this post just now. Not sure if there's anything helpful in
> there.
> https://github.com/PostgresApp/PostgresApp/issues/96
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876012.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



This is the last log entries:
LOG:  database system was shut down at 2015-12-01 21:56:22 EST
LOG:  MultiXact member wraparound protections are now enabled
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876028.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/02/2015 05:46 PM, Sribeiro wrote:
> This is the last log entries:
> LOG:  database system was shut down at 2015-12-01 21:56:22 EST
> LOG:  MultiXact member wraparound protections are now enabled
> LOG:  autovacuum launcher started
> LOG:  database system is ready to accept connections

Well that indicates whatever server created the log entries is up and 
running.

What is the timestamp of the log file?

What directory is this log file in?

>
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876028.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



The time stamp says it was created on Nov 23, and last modified on Dec 1.
It's inside the copy of the old postgres folder on my desktop.



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876118.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 05:00 AM, Sribeiro wrote:
> The time stamp says it was created on Nov 23, and last modified on Dec 1.
> It's inside the copy of the old postgres folder on my desktop.

My suspicion is you have crossed wires here, two Postgres clusters and 
confusion about which one is the actual 'live' one. A vague answer, but 
maybe a starting point for figuring out what is going on.

To reprise:

1) You have a fresh install at /usr/local/var/postgres. At that location 
you have no server.log, correct?

2) You have the old install on your Desktop and it has many server.logs, 
including the one timestamped above.

The Desktop does not exist outside the file system, so can you find the 
actual path to this install?

Also, I am guessing this install is the one without the pg_filenode.map 
in $PGDATA/global, correct?

>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876118.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



1) yes, I have a fresh install from yesterday in the /usr/local/var/postgres
directory. Yesterday there was no server.log in that directory, but today I
have a server.log in that directory. There's only one timestamp:
/LOG:  database system was shut down at 2015-12-02 16:33:52 EST
LOG:  MultiXact member wraparound protections are now enabled
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections/

2) Yes, but only one server.log file with many entries/timestamps that
includes the timestamp mentioned previously.

3) Here is the path to the directory where the older server.log resides -
/Users/Serge/Desktop/postgres

4) Both installs have the pg_filenode.map inside the global directory, but
when I ran the commands from yesterday, I kept getting the error message:
/psql: FATAL:  could not open relation mapping file
"global/pg_filenode.map": No such file or directory /



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876161.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 08:33 AM, Sribeiro wrote:
> 1) yes, I have a fresh install from yesterday in the /usr/local/var/postgres
> directory. Yesterday there was no server.log in that directory, but today I
> have a server.log in that directory. There's only one timestamp:
> /LOG:  database system was shut down at 2015-12-02 16:33:52 EST
> LOG:  MultiXact member wraparound protections are now enabled
> LOG:  autovacuum launcher started
> LOG:  database system is ready to accept connections/
>
> 2) Yes, but only one server.log file with many entries/timestamps that
> includes the timestamp mentioned previously.
>
> 3) Here is the path to the directory where the older server.log resides -
> /Users/Serge/Desktop/postgres
>
> 4) Both installs have the pg_filenode.map inside the global directory, but

How can that be?
From previous posts:
"

Dec 02, 2015; 1:06pm Sribeiro Sribeiro
This is what that directory looks like - http://postimg.org/image/olhb2zra9/

I can't find anywhere on my system (doing a search) the .map file.

Thank you for clarifying the importance of that file.
Since I didn't have any important information on it, can I start from 
scratch, and thus creating a new .map file?

Sergio

Dec 02, 2015; 1:44pm Sribeiro Sribeiro
This post was updated on Dec 02, 2015; 1:45pm.
Hi Adrian,

So, i made sure to copy the postgres directory then deleted the main one 
as to not conflict with a fresh install.

Once I got to the section in the instructions I used that says to run 
the - rake db:create:all
I get the following error:
rake db:create:all
FATAL:  could not open relation mapping file "global/pg_filenode.map": 
No such file or directory

BUT, if I look in the newest postgres/global directory, the 
pg_filenode.map is in there.

Any thoughts

Sergio
"


Are you sure /Users/Serge/Desktop/postgres is not a link to somewhere?


> when I ran the commands from yesterday, I kept getting the error message:
> /psql: FATAL:  could not open relation mapping file
> "global/pg_filenode.map": No such file or directory /

Have you tried stopping Postgres and then restarting it?

>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876161.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



I have no idea, how these files have emerged... I am so confused. lol.
I did have to restart the computer yesterday, could the restart have caused
to create the files?

Right now, both the fresh install and the old backup on my desktop have the
server.log file and the .map file inside the global directory.

What can I do to see if it is running correctly?



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876168.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 10:29 AM, Sribeiro wrote:
> I have no idea, how these files have emerged... I am so confused. lol.
> I did have to restart the computer yesterday, could the restart have caused
> to create the files?
>
> Right now, both the fresh install and the old backup on my desktop have the
> server.log file and the .map file inside the global directory.
>
> What can I do to see if it is running correctly?
>
From terminal:

ls -al /Users/Serge/Desktop/

and then

ps ax| grep post

>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876168.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



1st command I get:
/[~ (master)]$ ls -al /Users/Serge/Desktop/
total 77392
drwx------+ 13 Serge  staff       442 Dec  3 14:35 .
drwxr-xr-x+ 43 Serge  staff      1462 Nov  1 00:04 ..
-rw-r--r--@  1 Serge  staff     10244 Dec  3 14:35 .DS_Store
drwxr-xr-x   8 Serge  staff       272 Dec  3 11:35 Adobe CC
-rw-r--r--@  1 Serge  staff       275 Nov 23 21:00 Could not open relation
mapping file "global-pg_filenode.map" · .webloc
-rw-r--r--@  1 Serge  staff   1650428 Dec  3 01:46 IMG_0568.JPG
-rw-r--r--@  1 Serge  staff   2161564 Dec  3 01:51 IMG_0569.JPG
-rw-r--r--@  1 Serge  staff       280 Nov 23 21:00 PostgreSQL - PostgreSQL -
sql | Mailing List Archive.webloc
-rw-r--r--@  1 Serge  staff       277 Nov 23 21:00 PostgreSQL | dBforums –
Everything on Databases, Design, Develop.webloc
-rw-r--r--@  1 Serge  staff    483734 Dec  2 14:28 TST_HeadSection_2015.jpg
-rw-r--r--@  1 Serge  staff   6532736 Nov 29 12:24 emt_Home.psd
drwx------  27 Serge  staff       918 Dec  1 21:57 postgres
-rw-r--r--@  1 Serge  staff  28683898 Dec  3 11:20 x-mas_card.ai/

2nd command i get:
/[~ (master)]$ ps ax| grep post 303   ??  S      0:00.07 /usr/local/opt/postgresql/bin/postgres -D
/usr/local/var/postgres -r /usr/local/var/postgres/server.log 387   ??  Ss     0:00.02 postgres: checkpointer process
388  ??  Ss     0:00.44 postgres: writer process 389   ??  Ss     0:00.44 postgres: wal writer process 390   ??  Ss
0:00.22postgres: autovacuum launcher process 391   ??  Ss     0:00.39 postgres: stats collector process3922 s000  R+
0:00.00 grep post/ 



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876183.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 11:38 AM, Sribeiro wrote:
> 1st command I get:
> /[~ (master)]$ ls -al /Users/Serge/Desktop/
> total 77392
> drwx------+ 13 Serge  staff       442 Dec  3 14:35 .
> drwxr-xr-x+ 43 Serge  staff      1462 Nov  1 00:04 ..
> -rw-r--r--@  1 Serge  staff     10244 Dec  3 14:35 .DS_Store
> drwxr-xr-x   8 Serge  staff       272 Dec  3 11:35 Adobe CC
> -rw-r--r--@  1 Serge  staff       275 Nov 23 21:00 Could not open relation
> mapping file "global-pg_filenode.map" · .webloc
> -rw-r--r--@  1 Serge  staff   1650428 Dec  3 01:46 IMG_0568.JPG
> -rw-r--r--@  1 Serge  staff   2161564 Dec  3 01:51 IMG_0569.JPG
> -rw-r--r--@  1 Serge  staff       280 Nov 23 21:00 PostgreSQL - PostgreSQL -
> sql | Mailing List Archive.webloc
> -rw-r--r--@  1 Serge  staff       277 Nov 23 21:00 PostgreSQL | dBforums –
> Everything on Databases, Design, Develop.webloc
> -rw-r--r--@  1 Serge  staff    483734 Dec  2 14:28 TST_HeadSection_2015.jpg
> -rw-r--r--@  1 Serge  staff   6532736 Nov 29 12:24 emt_Home.psd
> drwx------  27 Serge  staff       918 Dec  1 21:57 postgres
> -rw-r--r--@  1 Serge  staff  28683898 Dec  3 11:20 x-mas_card.ai/
>
> 2nd command i get:
> /[~ (master)]$ ps ax| grep post
>    303   ??  S      0:00.07 /usr/local/opt/postgresql/bin/postgres -D
> /usr/local/var/postgres -r /usr/local/var/postgres/server.log
>    387   ??  Ss     0:00.02 postgres: checkpointer process
>    388   ??  Ss     0:00.44 postgres: writer process
>    389   ??  Ss     0:00.44 postgres: wal writer process
>    390   ??  Ss     0:00.22 postgres: autovacuum launcher process
>    391   ??  Ss     0:00.39 postgres: stats collector process
>   3922 s000  R+     0:00.00 grep post/
>
From a previous post:

"After running your command i get:
PATH=/Users/Serge/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"

All I got left is that the postgres/ in /Users/Serge/Desktop/ is causing 
the problem. I would get rid of that directory, you said previously 
there was nothing important in it. Either just delete it or if move it 
off the machine onto a USB drive, etc. I would then restart the Postgres 
server and try connecting with psql.

>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876183.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Ok I stopped and restarted the Postgres Server. 

Then I navigated to the directory of my RoR application and tried to run the
final 2 steps from the information I was following
https://launchschool.com/blog/how-to-install-postgresql-on-a-mac

Upon running the rake db:create:all command, I get:
/FATAL:  role "serge" does not exist/

Since this is a different error than i would get previously, I hope its a
good sign.



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876192.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 12:55 PM, Sribeiro wrote:
> Ok I stopped and restarted the Postgres Server.
>
> Then I navigated to the directory of my RoR application and tried to run the
> final 2 steps from the information I was following
> https://launchschool.com/blog/how-to-install-postgresql-on-a-mac
>
> Upon running the rake db:create:all command, I get:
> /FATAL:  role "serge" does not exist/
>
> Since this is a different error than i would get previously, I hope its a
> good sign.

Yes it is, you have made contact with the database and it is telling you 
that serge does not exist as a database user. Per my previous 
instructions try some commands with psql first. Right now we need to 
establish what is possible before getting to the RoR stage. My general 
experience is that if you can't do something with psql then going any 
further is not productive.

So in terminal:

psql -d postgres -U postgres


>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876192.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Btw. I copied the old Postgres folder to a usb and deleted from my desktop.
so now I only have the fresh install from yesterday. I did before i
stopped/started the Postgres server.

I ran the command, and I get:
psql: FATAL:  role "postgres" does not exist



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876199.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 01:15 PM, Sribeiro wrote:
> Btw. I copied the old Postgres folder to a usb and deleted from my desktop.
> so now I only have the fresh install from yesterday. I did before i
> stopped/started the Postgres server.
>
> I ran the command, and I get:
> psql: FATAL:  role "postgres" does not exist
>

Alright try:

psql -d postgres -U Serge

Also what are the contents of /usr/local/var/postgres/pg_hba.conf?

>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876199.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Running that command I get:
/psql (9.4.4)
Type "help" for help.

postgres=#/

The contents inside the pg_hba.conf file are:
/# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file.  A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access.  Records take one of these forms:
#
# local      DATABASE  USER  METHOD  [OPTIONS]
# host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# plain TCP/IP socket.
#
# DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof.  In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches.  It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask.  A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts.  Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
# "ident", "peer", "pam", "ldap", "radius" or "cert".  Note that
# "password" sends passwords in clear text; "md5" is preferred since
# it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE.  The available options depend on the different
# authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted.  Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with
# that name.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal.  If you edit the file on a running system, you have
# to SIGHUP the postmaster for the changes to take effect.  You can
# use "pg_ctl reload" to do that.

# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records.  In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.

# CAUTION: Configuring the system for local "trust" authentication
# allows any local user to connect as any PostgreSQL user, including
# the database superuser.  If you do not trust all your local users,
# use another authentication method.


# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     Serge                                trust
#host    replication     Serge        127.0.0.1/32            trust
#host    replication     Serge        ::1/128                 trust/




--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876201.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 01:27 PM, Sribeiro wrote:
> Running that command I get:
> /psql (9.4.4)
> Type "help" for help.
>
> postgres=#/

Cool, you are connected. From the above psql prompt do:

postgres=#/\du

That will return a list of users(roles) that are set up on the database 
cluster. FYI, users(roles) are global to all databases in a Postgres 
cluster. You should see at least Serge and my guess,  with an attribute 
of Superuser. If that is the case then you can run the Rake command 
again, but be sure to change username: in config/database.yml from serge 
to Serge, usernames are case sensitive.

As to below your authentication is set up as trust across the board, 
that means no password or any other authentication. Not a desirable 
situation long term. For now while you are figuring things out you can 
probably leave alone. If you expose this database to the public I would 
spend some time at the link below before proceeding too much further:

http://www.postgresql.org/docs/9.4/interactive/client-authentication.html
>
> The contents inside the pg_hba.conf file are:
> /# PostgreSQL Client Authentication Configuration File
> # ===================================================
> #
> # Refer to the "Client Authentication" section in the PostgreSQL
> # documentation for a complete description of this file.  A short
> # synopsis follows.
> #
> # This file controls: which hosts are allowed to connect, how clients
> # are authenticated, which PostgreSQL user names they can use, which
> # databases they can access.  Records take one of these forms:
> #
> # local      DATABASE  USER  METHOD  [OPTIONS]
> # host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> # hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> # hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
> #
> # (The uppercase items must be replaced by actual values.)
> #
> # The first field is the connection type: "local" is a Unix-domain
> # socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
> # "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
> # plain TCP/IP socket.
> #
> # DATABASE can be "all", "sameuser", "samerole", "replication", a
> # database name, or a comma-separated list thereof. The "all"
> # keyword does not match "replication". Access to replication
> # must be enabled in a separate record (see example below).
> #
> # USER can be "all", a user name, a group name prefixed with "+", or a
> # comma-separated list thereof.  In both the DATABASE and USER fields
> # you can also write a file name prefixed with "@" to include names
> # from a separate file.
> #
> # ADDRESS specifies the set of hosts the record matches.  It can be a
> # host name, or it is made up of an IP address and a CIDR mask that is
> # an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
> # specifies the number of significant bits in the mask.  A host name
> # that starts with a dot (.) matches a suffix of the actual host name.
> # Alternatively, you can write an IP address and netmask in separate
> # columns to specify the set of hosts.  Instead of a CIDR-address, you
> # can write "samehost" to match any of the server's own IP addresses,
> # or "samenet" to match any address in any subnet that the server is
> # directly connected to.
> #
> # METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
> # "ident", "peer", "pam", "ldap", "radius" or "cert".  Note that
> # "password" sends passwords in clear text; "md5" is preferred since
> # it sends encrypted passwords.
> #
> # OPTIONS are a set of options for the authentication in the format
> # NAME=VALUE.  The available options depend on the different
> # authentication methods -- refer to the "Client Authentication"
> # section in the documentation for a list of which options are
> # available for which authentication methods.
> #
> # Database and user names containing spaces, commas, quotes and other
> # special characters must be quoted.  Quoting one of the keywords
> # "all", "sameuser", "samerole" or "replication" makes the name lose
> # its special character, and just match a database or username with
> # that name.
> #
> # This file is read on server startup and when the postmaster receives
> # a SIGHUP signal.  If you edit the file on a running system, you have
> # to SIGHUP the postmaster for the changes to take effect.  You can
> # use "pg_ctl reload" to do that.
>
> # Put your actual configuration here
> # ----------------------------------
> #
> # If you want to allow non-local connections, you need to add more
> # "host" records.  In that case you will also need to make PostgreSQL
> # listen on a non-local interface via the listen_addresses
> # configuration parameter, or via the -i or -h command line switches.
>
> # CAUTION: Configuring the system for local "trust" authentication
> # allows any local user to connect as any PostgreSQL user, including
> # the database superuser.  If you do not trust all your local users,
> # use another authentication method.
>
>
> # TYPE  DATABASE        USER            ADDRESS                 METHOD
>
> # "local" is for Unix domain socket connections only
> local   all             all                                     trust
> # IPv4 local connections:
> host    all             all             127.0.0.1/32            trust
> # IPv6 local connections:
> host    all             all             ::1/128                 trust
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> #local   replication     Serge                                trust
> #host    replication     Serge        127.0.0.1/32            trust
> #host    replication     Serge        ::1/128                 trust/
>
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876201.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Yes I do get Serge as superuser
/                            List of rolesRole name |                   Attributes                   | Member of
-----------+------------------------------------------------+-----------Serge     | Superuser, Create role, Create DB,
Replication| {}
 

postgres-#/

I ran the rake db:create:all and the rake db:migrate commands with no
errors!!! Alas...

Adrian, you have been super awesome man. I appreciate ALL your efforts.
Thank you, Thank you!

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876205.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.



On 12/03/2015 01:54 PM, Sribeiro wrote:
> Yes I do get Serge as superuser
> /                            List of roles
>   Role name |                   Attributes                   | Member of
> -----------+------------------------------------------------+-----------
>   Serge     | Superuser, Create role, Create DB, Replication | {}
>
> postgres-#/
>
> I ran the rake db:create:all and the rake db:migrate commands with no
> errors!!! Alas...
>
> Adrian, you have been super awesome man. I appreciate ALL your efforts.
> Thank you, Thank you!

Thanks and good luck.

>
> Sergio
>
>
>
> --
> View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876205.html
> Sent from the PostgreSQL - sql mailing list archive at Nabble.com.
>
>


-- 
Adrian Klaver
adrian.klaver@aklaver.com



Thank you. Will definitely be consulting the link you sent about
authentication.

Thank you again.

Sergio



--
View this message in context:
http://postgresql.nabble.com/ERROR-while-creating-new-user-could-not-open-relation-mapping-file-global-pg-filenode-map-tp5874842p5876208.html
Sent from the PostgreSQL - sql mailing list archive at Nabble.com.