Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relation "<table>" Does Not Exist

Status
Not open for further replies.

theshaner6

Programmer
May 9, 2007
4
US
Hey everyone, new here because my usual community doesn't have much postgresql support, so hopefully I've come to the right place with this question.

I am receiving the error Relation propack_order does not exist. I've attempted putting quotes around the 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 submitting my own SQL with the SQL feature. I have a feeling it has to do something with my sequence number that is suppose to be automatically generated. I'm not sure why it would be seeing that it works perfectly when using the INSERT button and it's setup 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.

Sample 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). Also, this is a brand new table and sequence added to my DB. I've also dropped both the table and sequence and recreated them to no avail.

Any variation to the SQL or using other SQL queries result in the same error. The only answer I've found on the web (besides using quotes on the table name) is to rebuild the DB and that is NOT an option, hehe.

This is for version 8. Thanks for any help!

-Shane
 
in which schema is this table, and what is your search_path (the later I suppose is public)
 
I think u should write nextval('propack_order_order_id_seq'::text) (whitout quots)
 
@ceco: I'm sure it's a public schema, but I don't know much more about it right now. The server is down, so I have no access to the DB and phpPgAdmin right now to get you more info on it.

@rski: I've tried only single quotes, only double quotes, and single quotes enclosed by double quotes. All my other sequences in the DB are set up with double quotes enclosed by single quotes like is shown in my original post.

Thanks for trying. I'll get you all more info as soon as it gets back online.

-Shane
 
All tables are just in the standard public schema. I've yet to figure out this problem. I'm not sure what to try next, but if anyone can add any more advice, I'd appreciate it. I'd really like to get the features I'm working on up and running soon for my client. Thanks!

-Shane
 
*SOLVED*

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 all the help!

-Shane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top