0

I am learning how to use PostgreSQL and I have inserted data in my table but I cannot see the data when I click view rows. I get the error message below(2).

(1)Here is the create Table Statement

-- Table: "Test2 Schema"."Jobsearch"

-- DROP TABLE "Test2 Schema"."Jobsearch";

CREATE TABLE "Test2 Schema"."Jobsearch"
(
    "JobTitle" character varying(30) COLLATE pg_catalog."default",
    "Location" character varying(40) COLLATE pg_catalog."default",
    "Salary" integer,
    "Description" character varying(4000) COLLATE pg_catalog."default",
    "Currency" character varying(6) COLLATE pg_catalog."default",
    "Duration" character varying COLLATE pg_catalog."default",
    "Ref" integer NOT NULL,
    CONSTRAINT "Jobsearch_pkey" PRIMARY KEY ("Ref")
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE "Test2 Schema"."Jobsearch"
    OWNER to adelton;

(2)Here is the error message I get when try to view all rows

ERROR: column "ref" does not exist LINE 2: ORDER BY Ref ASC ^ HINT: Perhaps you meant to reference the column "Jobsearch.Ref". ********** Error ********** ERROR: column "ref" does not exist SQL state: 42703 Hint: Perhaps you meant to reference the column "Jobsearch.Ref". Character: 51

(3)Here is the Select statement I can use to see the row by using the select script

SELECT "JobTitle", "Location", "Salary", "Description", "Currency", "Duration", "Ref"
    FROM "Test2 Schema"."Jobsearch";

I can see the data when I use the select script.I have included two print screens one showing the select statement output and the other the view row output with the error message.

enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Have you made any recent change (structural) to that table? Try refreshing it (by pressing f5 on) that panel and then try again – Jorge Campos Apr 20 '17 at 17:54
  • Your error message indicates you have an `order by` that you have not shown us. And it also clearly shows that that order by is `order by ref` but it needs to be `order by "Ref"` - another good example on why avoiding quoted identifiers is a good thing –  Apr 21 '17 at 21:45
  • thank you both for your advice.I have managed to sort this problem by using lowercase letters for the column names and also using single quotes when entering the strings .I can now see the data when I click on view rows. – John Tomasson Apr 21 '17 at 23:55

0 Answers0