From: Nathan Fain <nathan@fains.com>
To: pgsql-interfaces@postgresql.org
Subject: Problem with "'"
Date: Sun, 12 Sep 1999 17:17:59 -0500
Message-ID: <37DC2697.14E6D1DF@fains.com> (raw)
This would a Q better suited for a perl/DBI group but I couldn't find
any.
The problem I am having concerns a bug a found when using PostgreSQL
w/Perl and the DBI::Pg module.
The problem has do do with he following statement:
$create = $db-handle->prepare(q{
CREATE TABLE ? values (one text, two text)});
$name = "tablename";
$create->execute($name);
# my syntax could be off, i doesn't look it though
The problem is when execute() does its thing it passes the $name with
surrounding "'"s. The CREATE TABLE statement changes to:
CREATE TABLE 'tablename' values (one text, two text);
this causes a error. Seems as though postgreSQL doesn't like the name
given to the table with the single quotation marks around it.
if I do this:
$create->execute("$name");
it will create a table named 'tablename' in the database (including the
single quotes).
I've tried changing the q{ } to qq{ } and it didn't help. This seems like
a bug, or is it a feature? Was wondering if anyone else had any ideas.
Thanks in advanced.
- Nathan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: nathan@fains.com
Subject: Re: Problem with "'"
In-Reply-To: <37DC2697.14E6D1DF@fains.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox