Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts

    PostGreSQL8: Relation "<table>" Does Not Exist

    Why oh why do I get this? I've attempted putting quotes around my table name in my SQL query, but it still does not remedy this. I shouldn't need the quotes anyway, seeing that the table name is in all lowercase. When working in phpPgAdmin, I can insert rows just fine using the INSERT feature, but cannot when using the SQL feature. I have a feeling it has to do something with my sequence number that is suppose to be automatically generated, although it's copied and used exactly like my other sequences.

    The default value of my order_id field in my propack_order table is set to nextval('"propack_order_order_id_seq"'::text). That sequence is just an integer, starts at 1 and increments by 1.

    SQL looks like:
    Code:
    INSERT INTO propack_order (member) VALUES ('Shane')
    Which should result in an automatic assignment of the next integer in the sequence for order_id and a member name of Shane and the rest of the columns null (and yes, they're allowed to be null).

    -Shane

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    what you've posted should work, provided propack_order is actually the name of the table. The error seems to imply that it might not be.
    typing \dt in psql definitely has it as you've spelt it? and the schema column shows 'public'? post the output of 'd propack_order'
    How did you create the table? In particular the id column- did you use the 'serial' type, or create the sequence manually and set it as the default? When I create a sequence via either method, it shows the cast to 'regclass' rather than 'text' in your post (the ::'text' after the sequence name).
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

  • #3
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    GJay, thanks so much for trying to help. I didn't think there was anyone in these forums that would, haha.

    However, the problem has been solved and had nothing to do with me, which is good, haha. Apparently, the guy who runs the servers has been having problems with them. phpPgAdmin was showing that I had created the table and sequence (I had even recreated them several times) and I was even able to alter them. However, the DB never seemed to recognize the sequence and table. The next day, phpPgAdmin wouldn't allow me to login and that continued for the next couple days. It went back up today and both the sequence and table didn't exist. I created them, yet again, and it works just fine now. Interesting.

    Thanks for trying GJay!

    -Shane


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •