• Why does this third line work, and the first two not?

    From Luuk@21:1/5 to All on Thu Apr 27 20:03:07 2017
    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)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ikke@21:1/5 to Luuk on Thu Apr 27 20:53:27 2017
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to Luuk on Thu Apr 27 20:10:35 2017
    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)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to Ikke on Fri Apr 28 18:06:32 2017
    On 27-04-17 20:53, Ikke wrote:
    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


    no, i do not think so:

    abcd=# select i, test from test where i=1;
    i | test
    ---+------
    1 | XYZ
    (1 row)


    abcd=# select i, "test" from test where i=1;
    i | test
    ---+------
    1 | XYZ
    (1 row)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to Rainer Weikusat on Fri Apr 28 18:07:34 2017
    On 27-04-17 21:10, Rainer Weikusat wrote:
    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 ...

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Dimitri Fontaine@21:1/5 to Luuk on Sun Apr 30 18:15:19 2017
    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,
    --
    Dimitri Fontaine
    PostgreSQL DBA, Architecte

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Luuk@21:1/5 to Dimitri Fontaine on Sun Apr 30 21:48:30 2017
    On 30-04-17 18:15, Dimitri Fontaine wrote:
    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,


    ok, i will have a look at this.

    At first i thought, i dont need a conversion from MySQL to PostgreSQL
    But a closer look revealed pgloader also does import CSV ;)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)