Re: Importing SQLite database

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Importing SQLite database
Date: 2016-12-08 15:14:23
Message-ID: 339fa54d-5000-57cc-126f-de7aa66735f3@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/08/2016 07:02 AM, Igor Korot wrote:
> Adrian,
>

> Anything else you see?
> Does Postgres uses single quotes for literal values or double quotes?

Single:

https://www.postgresql.org/docs/9.5/static/sql-syntax-lexical.html

> I'm talking about
> INSERT INTO... VALUES(); statements.
>
> SQLite does use double quotes, but I already cleaned it using single ones.

That may be going away:

http://sqlite.org/lang_keywords.html

"For resilience when confronted with historical SQL statements, SQLite
will sometimes bend the quoting rules above:

If a keyword in single quotes (ex: 'key' or 'glob') is used in a
context where an identifier is allowed but where a string literal is not
allowed, then the token is understood to be an identifier instead of a
string literal.

If a keyword in double quotes (ex: "key" or "glob") is used in a
context where it cannot be resolved to an identifier but where a string
literal is allowed, then the token is understood to be a string literal
instead of an identifier.

Programmers are cautioned not to use the two exceptions described in the
previous bullets. We emphasize that they exist only so that old and
ill-formed SQL statements will run correctly. Future versions of SQLite
might raise errors instead of accepting the malformed statements covered
by the exceptions above."

>
> Thank you.
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2016-12-08 15:16:05 Re: PDF files: to store in database or not
Previous Message Adrian Klaver 2016-12-08 15:08:31 Re: Importing SQLite database