Why does this third line work, and the first two not?
abcd=# select RequestMessageId from table_details;
ERROR: column "requestmessageid" does not exist
LINE 1: select RequestMessageId from table_details;
^
HINT: Perhaps you meant to reference the column "table_details.RequestMessageId".
abcd=# select a.RequestMessageId from table_details a;
ERROR: column a.requestmessageid does not exist
LINE 1: select a.RequestMessageId from table_details a;
^
HINT: Perhaps you meant to reference the column "a.RequestMessageId".
abcd=# select a."RequestMessageId" from table_details a;
RequestMessageId
------------------
(0 rows)
Why does this third line work, and the first two not?
abcd=# select RequestMessageId from table_details;
ERROR: column "requestmessageid" does not exist
LINE 1: select RequestMessageId from table_details;
^
HINT: Perhaps you meant to reference the column "table_details.RequestMessageId".
abcd=# select a.RequestMessageId from table_details a;
ERROR: column a.requestmessageid does not exist
LINE 1: select a.RequestMessageId from table_details a;
^
HINT: Perhaps you meant to reference the column "a.RequestMessageId".
abcd=# select a."RequestMessageId" from table_details a;
RequestMessageId
------------------
(0 rows)
Luuk wrote:
Why does this third line work, and the first two not?
abcd=# select RequestMessageId from table_details;
ERROR: column "requestmessageid" does not exist
LINE 1: select RequestMessageId from table_details;
^
HINT: Perhaps you meant to reference the column
"table_details.RequestMessageId".
abcd=# select a.RequestMessageId from table_details a;
ERROR: column a.requestmessageid does not exist
LINE 1: select a.RequestMessageId from table_details a;
^
HINT: Perhaps you meant to reference the column "a.RequestMessageId".
abcd=# select a."RequestMessageId" from table_details a;
RequestMessageId
------------------
(0 rows)
Because the third one is simple asking to return the string "RequestMessageId" , not a column??
Herman Viaene
Luuk <luuk@invalid.lan> writes:
Why does this third line work, and the first two not?
abcd=# select RequestMessageId from table_details;
ERROR: column "requestmessageid" does not exist
LINE 1: select RequestMessageId from table_details;
^
HINT: Perhaps you meant to reference the column
"table_details.RequestMessageId".
abcd=# select a.RequestMessageId from table_details a;
ERROR: column a.requestmessageid does not exist
LINE 1: select a.RequestMessageId from table_details a;
^
HINT: Perhaps you meant to reference the column "a.RequestMessageId".
abcd=# select a."RequestMessageId" from table_details a;
RequestMessageId
------------------
(0 rows)
That's because unquoted SQL identifiers are not case-sensitive. If the
really uses a mixed-case name, accessing it requires a quoted
identifier, cf
mad_database=# create table blubb ("Fump" varchar);
CREATE TABLE
mad_database=# select Fump from blubb;
ERROR: column "fump" does not exist
LINE 1: select Fump from blubb;
^
mad_database=# select "Fump" from blubb;
Fump
------
(0 rows)
mad_database=# drop table blubb;
DROP TABLE
mad_database=# create table blubb (Fump varchar);
CREATE TABLE
mad_database=# select fUMP from blubb;
fump
------
(0 rows)
Thanks, i'm on the way movig from MySQL to PostgreSQL ...
Luuk <luuk@invalid.lan> writes:
Thanks, i'm on the way movig from MySQL to PostgreSQL ...
Have a look at pgloader, it might turn useful for you here…
http://pgloader.io
pgloader mysql://user@localhost/dbname postgresql:///dbname
Regards,
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 40:23:39 |
Calls: | 8,336 |
Calls today: | 13 |
Files: | 13,155 |
Messages: | 5,891,361 |
Posted today: | 1 |