[BUGS] CREATE USER and createuser not working the same

2007-09-13 Thread Stéphane Schildknecht
Hi,

It seems the shell command createuser and the SQL CREATE USER don't act
the same way, unless the documentation says they do.

In fact, asking to see the role created with the external command let
see that a superuser created that way hase rights of superuser AND
'create role', 'create DB' rights, while a superuser created with an SQL
query does have superuser rights, but it is said it doesn't have create
role and create db role.

The superuser created the second way can create a role or a DB
has the code do bypass these rights check, has the first test lokks for
superuser privileges.

I wonder then where this bug takes place, if ever you think it is a bug.
Is it just a undocumented difference?
I'm afraid it is just a bit more than that as it shows a superuser does
not have all the rights one would think he has. Despite the fact he
actually has them.

The difference comes from the fact that the external command "createuser
foo" translates into "CREATE ROLE foo SUPERUSER CREATEDB CREATEROLE
INHERIT LOGIN;"

Is it wrong to wonder that a superuser should have createdb and
createrole by default ?

I'm working with PostgreSQL8.2.4 on Kubuntu 7.04. PostgreSQL was
compiled. Seems to be the same with 8.2.5 version.



Let's create a superuser named 'superdba' with the shell command:

$ LANGUAGE=en_US createuser superdba
Shall the new role be a superuser? (y/n) y
CREATE ROLE

$ LANGUAGE=en_US psql postgres postgres -c '\du'
   List of roles
 Role name | Superuser | Create role | Create DB | Connections | Member of
---+---+-+---+-+---
 superdba  | yes   | yes | yes   | no limit|

The superuser has Create Role and Create DB rights.

Now let's do the same with a SQL query:

postgres=# create role superdba3 superuser login;
CREATE ROLE
postgres=# \du
   List of roles
 Role name | Superuser | Create role | Create DB | Connections | Member of
---+---+-+---+-+---
 superdba3 | yes   | no  | no| no limit|


Best regards,

-- 
Stéphane SCHILDKNECHT
Président de PostgreSQLFr
http://www.postgresqlfr.org




---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


[BUGS] BUG #3609: Failed to create process for initdb

2007-09-13 Thread Darren Ginter

The following bug has been logged online:

Bug reference:  3609
Logged by:  Darren Ginter
Email address:  [EMAIL PROTECTED]
PostgreSQL version: 8.2.4
Operating system:   Windows XP (SP2)
Description:Failed to create process for initdb
Details: 

I've been having a hard time getting Postgres installed on any Windows PCs
in a particular corporate environment due to an error "Failed to create
process for initdb" at the end of the install process (at which point
everything is rolled back).  This is likely due to group policy restrictions
placed upon Windows.

I have solved the problem by creating in advance the user account for
postgres and manually specifying *explicit* security permissions to the
\PROGRAM FILES\POSTGRESQL\8.2\ folder (recursively - it likely needs the BIN
directory but I didn't get that granular in my troubleshooting).  This
problem has been present for years now (ever since Postgres on Windows has
existed).  A web search reveals only bug #1635 which does not have the
proper solution.

I'm submitting this with hopes that either (a) the bug can be fixed in
future versions or (b) this documentation can be referenced by others with
the problem.  Thanks for a remarkable product (I've been using it on FreeBSD
with great success for ages).

---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly


Re: [BUGS] CREATE USER and createuser not working the same

2007-09-13 Thread Tom Lane
=?ISO-8859-1?Q?St=E9phane_Schildknecht?= <[EMAIL PROTECTED]> writes:
> It seems the shell command createuser and the SQL CREATE USER don't act
> the same way,

They aren't really claimed to.  But the difference you point to is
irrelevant, since a superuser has createrole and createdb privilege
(and every other privilege) independently of what those columns say.

regards, tom lane

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [BUGS] BUG #3486: doc bug - Preventing transaction ID wraparound failures

2007-09-13 Thread Bruce Momjian

Thanks, applied.

---

Fujii Masao wrote:
> 
> The following bug has been logged online:
> 
> Bug reference:  3486
> Logged by:  Fujii Masao
> Email address:  [EMAIL PROTECTED]
> PostgreSQL version: 8.3
> Operating system:   RHEL4
> Description:doc bug - Preventing transaction ID wraparound failures
> Details: 
> 
> According to "varsup.c - GetNewTransactionId()", the error message in
> transaction ID wraparound failures
> is different from the one in the document.
> 
> 
> *** ./doc/src/sgml/maintenance.sgml.orig  2007-07-26 10:44:19.0
> +0900
> --- ./doc/src/sgml/maintenance.sgml   2007-07-26 10:45:11.0 +0900
> ***
> *** 447,453 
>   until wraparound:
>   
>   
> ! ERROR:  database is shut down to avoid wraparound data loss in database
> "mydb"
>   HINT:  Stop the postmaster and use a standalone backend to VACUUM in
> "mydb".
>   
>   
> --- 447,453 
>   until wraparound:
>   
>   
> ! ERROR:  database is not accepting commands to avoid wraparound data loss
> in database "mydb"
>   HINT:  Stop the postmaster and use a standalone backend to VACUUM in
> "mydb".
>   
> 
> ---(end of broadcast)---
> TIP 5: don't forget to increase your free space map settings

-- 
  Bruce Momjian  <[EMAIL PROTECTED]>  http://momjian.us
  EnterpriseDB   http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [BUGS] psql \COPY accepts multiple NULL AS

2007-09-13 Thread Bruce Momjian

This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

---

Stephen Frost wrote:
-- Start of PGP signed section.
> Greetings,
> 
>   psql seems to accept syntax which would be rejected by the server,
>   which seems a bit odd:
> 
>   sfrost*=# \copy billing_data from ../BillingSamplePricerFile.csv
> with csv header quote as '"' null as 'abc' null as '123'
>   ERROR:  invalid input syntax for integer: ""
> 
>   vs.
> 
>   sfrost=# copy billing_data from stdin 
>with csv header quote as '"' null as 'abc' null as '123';
>   ERROR:  conflicting or redundant options
> 
>   Now, honestly, I'd like to see support for multiple 'NULL AS' strings,
>   but till that's added it'd probably be best if psql error'd on this
>   like the backend does rather than accepting it and then not doing it.
> 
>   Thanks!
> 
>   Stephen
-- End of PGP section, PGP failed!

-- 
  Bruce Momjian  <[EMAIL PROTECTED]>  http://momjian.us
  EnterpriseDB   http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---(end of broadcast)---
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate