You are here: Re: odbc: mysql vs. postgresql « PHP Programming Language « IT news, forums, messages
Re: odbc: mysql vs. postgresql

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация