-1

enter image description here

I just started to use PostgreSQL in my project, but i've this error when retrieving data from table. Is someone have suggestions for this problem?

Ivan Stoev
  • 195,425
  • 15
  • 312
  • 343

4 Answers4

2

It seems table name and column names are in CamelCase.

PostgreSQL treat all the statements in lower case generally, As you can see the error where table name is shown in lower case.

So if above is the case then cover all such table name and column names with "". so your query should be:

select "Id", "AccountID", "IsPurchase", "Stock_Symbol","Stock_PricePerShare","Shares","DateProcessed" from "AssetTransactions"

Please note that if any column name is in smallcase then no need to cover in "".

If your schema is other than public then your table name should be like "schema_name"."table_name"

Akhilesh Mishra
  • 5,876
  • 3
  • 16
  • 32
0

AssetTransactions table does not exist, or it may not be present in the current default schema.

Use query with schema SELECT * FROM public.AssetTransactions

Thirumal
  • 8,280
  • 11
  • 53
  • 103
0

The database query is on an undefined table. This error occurs due to improper database setup, unidentified table name, and so on.

For instance, the customer query on table name ‘pgtable‘ like:

SELECT * FROM  pgtable

This query is totally correct in case of a public schema. But, for a non-public schema ‘xx’ the query must be:

SELECT * FROM  "xx"."pgtable"

so first check that you have proper database setup, then check that you didnt quote any identifiers because then you'll have to use it as how u quoted it, then check your schema

swapnil
  • 21
  • 5
-2

I had a similar problem The problem is solved if the table names are in lower case Make sure all words are in lower case