I did rake db:create
and then rake db:migrate
and ran into this error.
rake aborted!
PGError: ERROR: relation "delayed_jobs" does not exist
LINE 4: WHERE a.attrelid = '"delayed_jobs"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"delayed_jobs"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
Your query is casting "delayed_jobs" to a regclass, which translates the name of a table to PostgreSQL's internal ID number. If the cast can't be made you get the error: SELECT 'foo'::regclass; ERROR: relation "foo" does not exist
Presumably your migrate script should be catching this error and creating the table (maybe the problem is it already thinks it has done so).
P.S. - The title of your question isn't helpful. PostgreSQL doesn't have a problem working with "delayed_job". Not only don't you have a table "delayed_job" but the problem is clearly with Rail's create or migrate scripts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With