|
Posted by Charles Calvert on 10/04/06 22:15
On Sun, 01 Oct 2006 12:02:53 +0200, Jacques Lebastard
<jacques.lebastard@free.fr> wrote in
<451f9254$0$23500$636a55ce@news.free.fr>:
>Jerry Stuckle a écrit :
>> Jacques Lebastard wrote:
>>>
>>> I have a problem writing PHP ODBC scripts that suit both MySQL and
>>> PostgreSQL. So far, the following syntaxes seem to apply to each
>>> database (this is an 'insert' example; the same differences apply to
>>> 'select commands):
>>>
>>> MySQL: INSERT INTO MyTable (col1, col2) VALUES ("value1","value2")
>>> PGSQL: INSERT INTO "MyTable" (col1, col2) VALUES ('value1','value2')
[snip]
>If they are supposed to support the same syntax, why does Postgres
>require table name with double quotes whereas I get an error using
>double quotes when accessing a MySQL DB? Is it a PHP issue, an ODBC
>driver issue?
They are required because the table name was created as a "quoted
identifier" (possibly by your admin tool). See the PostgreSQL FAQ:
<http://www.postgresql.org/docs/faqs.FAQ.html#item4.21>. Also see the
docs on identifiers:
<http://www.postgresql.org/docs/8.0/static/sql-syntax.html#SQL-SYNTAX-IDENTIFIERS>.
--
Charles Calvert | Software Design/Development
Celtic Wolf, Inc. | Project Management
http://www.celticwolf.com/ | Technical Writing
(703) 580-0210 | Research
[Back to original message]
|