BUG #4337: psql -c case insensitive

View: New views
3 Messages — Rating Filter:   Alert me  

BUG #4337: psql -c case insensitive

by none-28 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


The following bug has been logged online:

Bug reference:      4337
Logged by:          none
Email address:      nomind@...
PostgreSQL version: 8.2.3
Operating system:   windows xp
Description:        psql -c case insensitive
Details:

I'm programming an application that uses psql (...) -c "ALTER DATABASE
\"MyBase\" RENAME TO \"MyBase2\" and it doesn't work because it looks for a
"mybase" database name.

I'm using c# respecting case sensitive arguments, so I think the error is
with psql.

Check it ;)

--
Sent via pgsql-bugs mailing list (pgsql-bugs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: BUG #4337: psql -c case insensitive

by Tom Lane-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

"none" <nomind@...> writes:
> I'm programming an application that uses psql (...) -c "ALTER DATABASE
> \"MyBase\" RENAME TO \"MyBase2\" and it doesn't work because it looks for a
> "mybase" database name.

Works for me.  I speculate that your scripting language is losing the
embedded double-quotes somewhere before psql gets them.  I don't know
much about Windows scripting so it's hard to say more than that; but
an extra interpretation pass over the command string would probably
cause such a problem.

                        regards, tom lane

--
Sent via pgsql-bugs mailing list (pgsql-bugs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Re: BUG #4337: psql -c case insensitive

by Magnus Hagander-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tom Lane wrote:

> "none" <nomind@...> writes:
>> I'm programming an application that uses psql (...) -c "ALTER DATABASE
>> \"MyBase\" RENAME TO \"MyBase2\" and it doesn't work because it looks for a
>> "mybase" database name.
>
> Works for me.  I speculate that your scripting language is losing the
> embedded double-quotes somewhere before psql gets them.  I don't know
> much about Windows scripting so it's hard to say more than that; but
> an extra interpretation pass over the command string would probably
> cause such a problem.

Most likely you're bit by the completely insane rules of quoting in the
windows commandshell. See for example the comments around it in
src/port.h in the PostgreSQL distribution.

//Magnus

--
Sent via pgsql-bugs mailing list (pgsql-bugs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
LightInTheBox - Buy quality products at wholesale price!