Обсуждение: help (maybe i'm a little stupid)

Поиск
Список
Период
Сортировка

help (maybe i'm a little stupid)

От
"Fabrizio"
Дата:
hi everybody. i've a little problem and i don't know where are faq of ng.
(if you want, address me there, so you don't have to answer my boring
question ;-)  )
.
i made a page in php interfacing with postgresql server. i had a problem but
i solve that one assuming postmaster with options -i and specifying port
5432. but then, when i call via browser my page, it returns error "fatal1:
user apache does not exist...". if i must modify pg_hba.conf, how can i do?
thanx
fab
fabrizio@eleveners.com




Re: help (maybe i'm a little stupid)

От
Steve Brett
Дата:
ph_hba.conf controls which machines can connect to postgresql and lines are
easy to add if you lok at the examples contained within the file.

however yuo would get an error that says 'there is no entry in pg_hba.conf
for ipX.X.X.X' or something like that -

what you probably need to do is add a database user using 'createuser' ...

Steve

> -----Original Message-----
> From: Fabrizio [mailto:fabrizio@eleveners.com]
> Sent: 15 July 2002 07:45
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] help (maybe i'm a little stupid)
>
>
> hi everybody. i've a little problem and i don't know where
> are faq of ng.
> (if you want, address me there, so you don't have to answer my boring
> question ;-)  )
> .
> i made a page in php interfacing with postgresql server. i
> had a problem but
> i solve that one assuming postmaster with options -i and
> specifying port
> 5432. but then, when i call via browser my page, it returns
> error "fatal1:
> user apache does not exist...". if i must modify pg_hba.conf,
> how can i do?
> thanx
> fab
> fabrizio@eleveners.com
>
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>

Re: help (maybe i'm a little stupid)

От
Thomas Beutin
Дата:
Hi,

On Mon, Jul 15, 2002 at 08:44:39AM +0200, Fabrizio wrote:
> i made a page in php interfacing with postgresql server. i had a problem but
> i solve that one assuming postmaster with options -i and specifying port
> 5432. but then, when i call via browser my page, it returns error "fatal1:
> user apache does not exist...". if i must modify pg_hba.conf, how can i do?
> thanx
Look for the "createuser" shell command. And don't forget to give the permission
for the tables to this user ("GRANT" command on the psql prompt).
OR
Connect to the databes as the database super (NOT RECOMMENDED).

INHO the best thing is to create an user apache without permission for
database or table creation.

-tb
--
Thomas Beutin                             tb@laokoon.IN-Berlin.DE
Beam me up, Scotty. There is no intelligent live down in Redmond.

Re: help (maybe i'm a little stupid)

От
terry@greatgulfhomes.com
Дата:
Yeah but, in 7.2.1 isn't it true that there is no way to stop a user from
being able to create tables???  I tried myself, with no success, and later
read on the newsgroup that it is a feature to be coming soon, but current
release 7.2.1 does not have that control.

Terry Fielder
Network Engineer
Great Gulf Homes / Ashton Woods Homes
terry@greatgulfhomes.com

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org
> [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Thomas Beutin
> Sent: Monday, July 15, 2002 9:17 AM
> To: Fabrizio
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] help (maybe i'm a little stupid)
>
>
> Hi,
>
> On Mon, Jul 15, 2002 at 08:44:39AM +0200, Fabrizio wrote:
> > i made a page in php interfacing with postgresql server. i
> had a problem but
> > i solve that one assuming postmaster with options -i and
> specifying port
> > 5432. but then, when i call via browser my page, it returns
> error "fatal1:
> > user apache does not exist...". if i must modify
> pg_hba.conf, how can i do?
> > thanx
> Look for the "createuser" shell command. And don't forget to
> give the permission
> for the tables to this user ("GRANT" command on the psql prompt).
> OR
> Connect to the databes as the database super (NOT RECOMMENDED).
>
> INHO the best thing is to create an user apache without permission for
> database or table creation.
>
> -tb
> --
> Thomas Beutin                             tb@laokoon.IN-Berlin.DE
> Beam me up, Scotty. There is no intelligent live down in Redmond.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


Re: help (maybe i'm a little stupid)

От
Steve Brett
Дата:
i've just tested this and it seems to be the case.

i created a test db, then a test table, then a test user called fred.

then i did a revoke all on fred and then granted select.

then i connected as fred and tried to create a table and the table was
created.

i wouldn't have expected this to be the case ...

Steve

> -----Original Message-----
> From: terry@greatgulfhomes.com [mailto:terry@greatgulfhomes.com]
> Sent: 15 July 2002 15:42
> To: 'Thomas Beutin'; 'Fabrizio'
> Cc: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] help (maybe i'm a little stupid)
>
>
> Yeah but, in 7.2.1 isn't it true that there is no way to stop
> a user from
> being able to create tables???  I tried myself, with no
> success, and later
> read on the newsgroup that it is a feature to be coming soon,
> but current
> release 7.2.1 does not have that control.
>
> Terry Fielder
> Network Engineer
> Great Gulf Homes / Ashton Woods Homes
> terry@greatgulfhomes.com
>
> > -----Original Message-----
> > From: pgsql-general-owner@postgresql.org
> > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of
> Thomas Beutin
> > Sent: Monday, July 15, 2002 9:17 AM
> > To: Fabrizio
> > Cc: pgsql-general@postgresql.org
> > Subject: Re: [GENERAL] help (maybe i'm a little stupid)
> >
> >
> > Hi,
> >
> > On Mon, Jul 15, 2002 at 08:44:39AM +0200, Fabrizio wrote:
> > > i made a page in php interfacing with postgresql server. i
> > had a problem but
> > > i solve that one assuming postmaster with options -i and
> > specifying port
> > > 5432. but then, when i call via browser my page, it returns
> > error "fatal1:
> > > user apache does not exist...". if i must modify
> > pg_hba.conf, how can i do?
> > > thanx
> > Look for the "createuser" shell command. And don't forget to
> > give the permission
> > for the tables to this user ("GRANT" command on the psql prompt).
> > OR
> > Connect to the databes as the database super (NOT RECOMMENDED).
> >
> > INHO the best thing is to create an user apache without
> permission for
> > database or table creation.
> >
> > -tb
> > --
> > Thomas Beutin                             tb@laokoon.IN-Berlin.DE
> > Beam me up, Scotty. There is no intelligent live down in Redmond.
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>

Re: help (maybe i'm a little stupid)

От
Bruce Momjian
Дата:
Steve Brett wrote:
> i've just tested this and it seems to be the case.
>
> i created a test db, then a test table, then a test user called fred.
>
> then i did a revoke all on fred and then granted select.
>
> then i connected as fred and tried to create a table and the table was
> created.
>
> i wouldn't have expected this to be the case ...

Yes, this has been an admin failing for many releases now, finally to be
fixed in 7.3.

--
  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

Re: help (maybe i'm a little stupid)

От
ktt
Дата:
no :-)
just add

"sameuser" under
DATABASE
in your configuration line in pg_hba.conf

or read this:

# This record identifies networked hosts that are
permitted to connect
# via IP connections.
#
# Format:
#
#   host  DBNAME  IP_ADDRESS  ADDRESS_MASK  AUTH_TYPE
[AUTH_ARGUMENT]
#
# DBNAME can be:
#     o the name of a PostgreSQL database
#     o "all" to indicate all databases
#     o "sameuser" to allow access only to databases with
the same
#       name as the connecting user


so replace "all" with "sameuser" where you need this.

# TYPE     DATABASE    IP_ADDRESS    MASK
 AUTH_TYPE  AUTH_ARGUMENT

local      all
 trust
host       all         127.0.0.1     255.255.255.255
 trust



--- Thomas Beutin <tyrone@laokoon.IN-Berlin.DE> wrote:
> Hi,
>
> On Mon, Jul 15, 2002 at 08:44:39AM +0200, Fabrizio
> wrote:
> > i made a page in php interfacing with postgresql
> server. i had a problem but
> > i solve that one assuming postmaster with options
> -i and specifying port
> > 5432. but then, when i call via browser my page,
> it returns error "fatal1:
> > user apache does not exist...". if i must modify
> pg_hba.conf, how can i do?
> > thanx
> Look for the "createuser" shell command. And don't
> forget to give the permission
> for the tables to this user ("GRANT" command on the
> psql prompt).
> OR
> Connect to the databes as the database super (NOT
> RECOMMENDED).
>
> INHO the best thing is to create an user apache
> without permission for
> database or table creation.
>
> -tb
> --
> Thomas Beutin
> tb@laokoon.IN-Berlin.DE
> Beam me up, Scotty. There is no intelligent live
> down in Redmond.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

Re: help (maybe i'm a little stupid)

От
"Fabrizio Bues"
Дата:
well, solving my problems, i noticed that:
- i had to create user apache with ono permissions granted at psql level (no
creation db, no create user)
- i had to reinstall php (4.2.17) and its php-pgsql interfaces
- after all operation i restarted services invoked above.
eh eh, reading so, it seems to me, i'm very stupid....
;-)
thanx again to all




----- Original Message -----
From: "Steve Brett" <SBrett@e-mis.com>
To: <terry@greatgulfhomes.com>; "'Thomas Beutin'"
<tyrone@laokoon.IN-Berlin.DE>; "'Fabrizio'" <fabrizio@eleveners.com>
Cc: <pgsql-general@postgresql.org>
Sent: Monday, July 15, 2002 4:58 PM
Subject: RE: [GENERAL] help (maybe i'm a little stupid)


> i've just tested this and it seems to be the case.
>
> i created a test db, then a test table, then a test user called fred.
>
> then i did a revoke all on fred and then granted select.
>
> then i connected as fred and tried to create a table and the table was
> created.
>
> i wouldn't have expected this to be the case ...
>
> Steve
>
> > -----Original Message-----
> > From: terry@greatgulfhomes.com [mailto:terry@greatgulfhomes.com]
> > Sent: 15 July 2002 15:42
> > To: 'Thomas Beutin'; 'Fabrizio'
> > Cc: pgsql-general@postgresql.org
> > Subject: Re: [GENERAL] help (maybe i'm a little stupid)
> >
> >
> > Yeah but, in 7.2.1 isn't it true that there is no way to stop
> > a user from
> > being able to create tables???  I tried myself, with no
> > success, and later
> > read on the newsgroup that it is a feature to be coming soon,
> > but current
> > release 7.2.1 does not have that control.
> >
> > Terry Fielder
> > Network Engineer
> > Great Gulf Homes / Ashton Woods Homes
> > terry@greatgulfhomes.com
> >
> > > -----Original Message-----
> > > From: pgsql-general-owner@postgresql.org
> > > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of
> > Thomas Beutin
> > > Sent: Monday, July 15, 2002 9:17 AM
> > > To: Fabrizio
> > > Cc: pgsql-general@postgresql.org
> > > Subject: Re: [GENERAL] help (maybe i'm a little stupid)
> > >
> > >
> > > Hi,
> > >
> > > On Mon, Jul 15, 2002 at 08:44:39AM +0200, Fabrizio wrote:
> > > > i made a page in php interfacing with postgresql server. i
> > > had a problem but
> > > > i solve that one assuming postmaster with options -i and
> > > specifying port
> > > > 5432. but then, when i call via browser my page, it returns
> > > error "fatal1:
> > > > user apache does not exist...". if i must modify
> > > pg_hba.conf, how can i do?
> > > > thanx
> > > Look for the "createuser" shell command. And don't forget to
> > > give the permission
> > > for the tables to this user ("GRANT" command on the psql prompt).
> > > OR
> > > Connect to the databes as the database super (NOT RECOMMENDED).
> > >
> > > INHO the best thing is to create an user apache without
> > permission for
> > > database or table creation.
> > >
> > > -tb
> > > --
> > > Thomas Beutin                             tb@laokoon.IN-Berlin.DE
> > > Beam me up, Scotty. There is no intelligent live down in Redmond.
> > >
> > > ---------------------------(end of
> > > broadcast)---------------------------
> > > TIP 6: Have you searched our list archives?
> > >
> > > http://archives.postgresql.org
> > >
> >
> >
> > ---------------------------(end of
> > broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo@postgresql.org so that your
> > message can get through to the mailing list cleanly
> >
>