Re: [HACKERS] Createdb problem report

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Createdb problem report
Date: 1999-11-18 21:46:30
Message-ID: 199911182146.QAA12254@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Applied. Will appear in 7.0

[Charset iso-8859-1 unsupported, filtering to ASCII...]
> The attached report is still correct as of 6.5.3; but will having a
> database name that has to be quoted cause problems anywhere that SQL
> queries are constructed to do internal operations?
>
> The SQL command `CREATE DATABASE "www-data"' works correctly.
>
> ------- Forwarded Message
>
> Date: Thu, 18 Nov 1999 20:39:51 +0100
> From: Eric Gentilini <eric(dot)gentilini(at)eleve(dot)emn(dot)fr>
> To: olly(at)lfix(dot)co(dot)uk
> Subject: [POSTGRESQL] Does createdb belong to postgresql ?
>
> hi !
>
> I fixed a _very_ little bug in createdb and destroydb that prevents the
> creation of postgresql users whose name contains special characters, and
> especially '-', useful when accessing a database through a CGI script, whose
> user is 'www-data' by default.
>
> But I don't know if this prog is debian specific or if it belongs to
> postrgesql.
>
> Can you help me ?
> thx !
>
>
> ============================================================================
> POSTGRESQL BUG REPORT TEMPLATE
> ============================================================================
>
>
> Your name : Eric Gentilini
> Your email address : eric(dot)gentilini(at)eleve(dot)emn(dot)fr
>
>
> System Configuration
> - ---------------------
> Architecture (example: Intel Pentium) : Intel Pentium&PentiumII
>
> Operating System (example: Linux 2.0.26 ELF) : Linux 2.2.13 ELF
>
> PostgreSQL version (example: PostgreSQL-6.5.2): PostgreSQL-6.5.2
>
> Compiler used (example: gcc 2.8.0) : not compiled by me
>
>
> Please enter a FULL description of your problem:
> - ------------------------------------------------
> I don't know if it is really a bug or if it is intentionnal, but
> I found out that createdb and destroydb prevented the
> creation/destruction of postgresql users whose
> name contained special characters, and
> especially '-', useful when accessing a database through a CGI script, whose
> user is 'www-data' by default.
> (In this case, createdb is executed by createuser)
> The query aborts with the message "ERROR: parser: parse error at or near "-""
>
> Please describe a way to repeat the problem. Please try to provide a
> concise reproducible example, if at all possible:
> - ----------------------------------------------------------------------
> for instance : createdb www-data
>
>
> If you know how this problem might be fixed, list the solution below:
> - ---------------------------------------------------------------------
> The simplest solution I found is to modify the scripts createdb and destroydb.
> createdb : replace line 114 with :
> psql $PASSWDOPT -tq $AUTHOPT $PGHOSTOPT $PGPORTOPT -c "create
> database \"$dbname\" $location $encoding" template1
> ^^^ ^^^
> destroydb : replace line 78 with :
> psql -tq $AUTHOPT $PGHOSTOPT $PGPORTOPT -c "drop database \"$dbname\"" template
> 1
> ^^^ ^^^
>
> Eric (Yam) Gentilini
>
> Linux _ Nantes sur http://www.linux-nantes.fr.eu.org
>
>
> ------- End of Forwarded Message
>
>
> --
> Vote against SPAM: http://www.politik-digital.de/spam/
> ========================================
> Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
> Isle of Wight http://www.lfix.co.uk/oliver
> PGP key from public servers; key ID 32B8FAA1
> ========================================
> "A Song for the sabbath day. It is a good thing to
> give thanks unto the LORD, and to sing praises unto
> thy name, O most High." Psalms 92:1
>
>
>
> ************
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 1999-11-18 22:29:58 psql & regress tests
Previous Message Oliver Elphick 1999-11-18 21:19:33 Createdb problem report