BUG #4337: psql -c case insensitive

Started by noneover 17 years ago3 messagesbugs
Jump to latest
#1none
nomind@mailinator.com

The following bug has been logged online:

Bug reference: 4337
Logged by: none
Email address: nomind@mailinator.com
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 ;)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: none (#1)
Re: BUG #4337: psql -c case insensitive

"none" <nomind@mailinator.com> 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

#3Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#2)
Re: BUG #4337: psql -c case insensitive

Tom Lane wrote:

"none" <nomind@mailinator.com> 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