"relation does not exist", ERROR 42P01

Posted on 2005-04-07
Last Modified: 2011-04-14
Hi . . I've installed PostgreSQL 8.0, PgAdminIII and the Npgsql .NET data provider.

I've created a user, a database owned by that user, and set the database to accept connections.  

I can connect to the db server, and run a query like "SELECT VERSION()", but when I try to "SELECT COUNT(*)" from any table in the database, I get the error "relation TABLE_NAME does not exist".

Obviously, the connection to the server is fine, but for some reason the connection to the database isn't working.  I've never used PostgreSQL before this (mainly MySQL), so it could definitely be something simple I've overlooked.

Thanks, everyone :)

Question by:michaelwkane
    1 Comment
    LVL 22

    Accepted Solution

    login to your database using psql

    What tables are there using the following commands \dS is for system tables

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Best database to use for Maps is PostgreSQL. This is an open source database. Comes as a package with most Linux OS. For more info visit the following site: ( This requires some add-o…
    Many developers have database experience, but are new to PostgreSQL. It has some truly inspiring capabilities. I have several years' experience with Microsoft's SQL Server. When I began working with MySQL, I wanted a quick-reference to MySQL (htt…
    Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now