FAQ
Dear Sirs:

Postgresql was installed normally from source code in Ubuntu Hardy Heron
with standard configuration.

But I receive a message "Permission denied" when trying to run a .sql script
to create tables
in a already created database. The script is located in /usr/local/pgsql

Any suggestions?

Session example:

root@tikal:/home/pakal# su - postgres
No directory, logging in with HOME=/

$ /usr/local/pgsql/bin/psql -U neil -d bpsimple
psql (8.4.4)
Type "help" for help.

bpsimple=#

bpsimple=# \i /usr/local/pgsql/create_tables-bpsimple.sql
/usr/local/pgsql/create_tables-bpsimple.sql: Permission denied

Search Discussions

  • Jon Erdman at Jul 20, 2010 at 7:01 pm

    On 07/20/2010 01:14 PM, Antony Loop wrote:

    Dear Sirs:

    Postgresql was installed normally from source code in Ubuntu Hardy Heron
    with standard configuration.

    But I receive a message "Permission denied" when trying to run a .sql
    script to create tables
    in a already created database. The script is located in /usr/local/pgsql

    Any suggestions?

    Session example:

    root@tikal:/home/pakal# su - postgres
    No directory, logging in with HOME=/

    $ /usr/local/pgsql/bin/psql -U neil -d bpsimple
    psql (8.4.4)
    Type "help" for help.

    bpsimple=#

    bpsimple=# \i /usr/local/pgsql/create_tables-bpsimple.sql
    /usr/local/pgsql/create_tables-bpsimple.sql: Permission denied
    The unix user postgres doesn't have permission to read the file
    /usr/local/pgsql/create_tables-bpsimple.sql so as the user that owns
    that file do:

    chmod a+r /usr/local/pgsql/create_tables-bpsimple.sql
    - --
    Jon T Erdman (aka StuckMojo)
    PostgreSQL Zealot
  • Bryan Hinton at Jul 20, 2010 at 7:29 pm
    couple of items:
    might want to set $HOME for postgres to /usr/local/pgsql
    then chown create_tables-bpsimple.sql as appropriate
    last of all, check \dp after you fix the file permissions - to make sure
    neil can create tables
    On 7/20/10 1:14 PM, Antony Loop wrote:
    Dear Sirs:

    Postgresql was installed normally from source code in Ubuntu Hardy Heron
    with standard configuration.

    But I receive a message "Permission denied" when trying to run a .sql script
    to create tables
    in a already created database. The script is located in /usr/local/pgsql

    Any suggestions?

    Session example:

    root@tikal:/home/pakal# su - postgres
    No directory, logging in with HOME=/

    $ /usr/local/pgsql/bin/psql -U neil -d bpsimple
    psql (8.4.4)
    Type "help" for help.

    bpsimple=#

    bpsimple=# \i /usr/local/pgsql/create_tables-bpsimple.sql
    /usr/local/pgsql/create_tables-bpsimple.sql: Permission denied
  • Jon Erdman at Jul 20, 2010 at 11:25 pm
    Look closer, the permission denied was on the actual .sql file he was
    trying to read into psql...i.e. postgres user didn't have read on it,
    filesystem wise ;)
    - --
    Jon T Erdman (aka StuckMojo)
    PostgreSQL Zealot
    On 07/20/2010 02:20 PM, Bryan Hinton wrote:
    couple of items:
    might want to set $HOME for postgres to /usr/local/pgsql
    then chown create_tables-bpsimple.sql as appropriate
    last of all, check \dp after you fix the file permissions - to make sure
    neil can create tables
    On 7/20/10 1:14 PM, Antony Loop wrote:
    Dear Sirs:
    Postgresql was installed normally from source code in Ubuntu Hardy Heron
    with standard configuration.
    But I receive a message "Permission denied" when trying to run a .sql script
    to create tables
    in a already created database. The script is located in /usr/local/pgsql
    Any suggestions?
    Session example:
    root@tikal:/home/pakal# su - postgres
    No directory, logging in with HOME=/
    $ /usr/local/pgsql/bin/psql -U neil -d bpsimple
    psql (8.4.4)
    Type "help" for help.
    bpsimple=#
    bpsimple=# \i /usr/local/pgsql/create_tables-bpsimple.sql
    /usr/local/pgsql/create_tables-bpsimple.sql: Permission denied
  • Bryan Hinton at Jul 21, 2010 at 12:45 am
    chown postgres:postgres create_tables-bpsimple.sql && chmod 0640 $_
    On 7/20/10 6:24 PM, Jon Erdman wrote:


    Look closer, the permission denied was on the actual .sql file he was
    trying to read into psql...i.e. postgres user didn't have read on it,
    filesystem wise ;)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupaustinpug @
categoriespostgresql
postedJul 20, '10 at 6:14p
activeJul 21, '10 at 12:45a
posts5
users3
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2022 Grokbase