[rspec-users] RSpec and PostgreSQL not playing nicely together

Mark Wilden mark at mwilden.com
Tue Nov 4 12:15:00 EST 2008

> On Tue, Nov 4, 2008 at 11:33 AM, Fernando Perez <lists at ruby-forum.com>
> wrote:

> >      @product = Product.new

> > PGError: ERROR:  relation "products" does not exist

> > I don't understand why RSpec is trying to look for some kind of
> > relation. In the spec I am simply calling Product.new

PostgreSQL uses the term 'relation' for 'table' (hence the term 'relational
database'). Some folks think that a relation is a relationship between one
table and another, via a shared column value, or key. However, a relation is
actually the relationship between the values of the columns in a the rows of
a table. A database consists of a set of these relations, each of which
satisfies a given logical statement, or predicate. For example, your
products table is set of related columns and rows such that every row
corresponds to a "product" in your system, whose column values match
attributes of that product.

My first guess as to your problem is that you need to run 'rake db:migrate'.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081104/627b5a00/attachment.html>

More information about the rspec-users mailing list