Postgresql-li vložit řetězec

Příklady kódu

0
0

postgresql-li vložit řetězec

# When I used Python to insert values into PostgreSQL, I also met the question: column "xxx" does not exist.
# The I find the reason in wiki.postgresql:
# PostgreSQL uses only single quotes for this (i.e. WHERE name = 'John'). Double quotes are used to quote system identifiers; field names, table names, etc. (i.e. WHERE "last name" = 'Smith').
# MySQL uses ` (accent mark or backtick) to quote system identifiers, which is decidedly non-standard.
# It means PostgreSQL can use only single quote for field names, table names, etc. So you can not use single quote in value.
# My situation is: I want to insert values "the difference of it’s adj for sb and it's adj of sb" into PostgreSQL.
# How I figure out this problem:
#I replace ' with ’, and I replace " with '. Because PostgreSQL value does not support double quote.
insert into test values (1,'user’s log');
insert into test values (2,'my users');
insert into test values (3,'customer’s');

Související stránky

Související stránky s příklady

V jiných jazycích

Tato stránka je v jiných jazycích

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................