Re: PGError: ERROR: missing FROM-clause entry for table - Mailing list pgsql-general

From James B. Byrne
Subject Re: PGError: ERROR: missing FROM-clause entry for table
Date
Msg-id 60401.70.50.88.137.1290741220.squirrel@webmail.harte-lyne.ca
Whole thread Raw
In response to Re: PGError: ERROR: missing FROM-clause entry for table  (Robert Treat <rob@xzilla.net>)
List pgsql-general
On Thu, November 25, 2010 21:58, Robert Treat wrote:
> On Thu, Nov 25, 2010 at 9:21 PM, James B. Byrne
> <byrnejb@harte-lyne.ca>wrote:

>>
>
> Looks to me like the problem is you are trying to ORDER BY columns
> in
> "ca_customs_entry", but there is no such table for that (don't
> confuse it
> with "ca_customs_entries").  You need to either set a matching
> alias, or fix
> the table name qualifier in those order by columns.

That was exactly the problem.  Thank you very much.  I am afraid
that the mental gymnastics that Rails requires--table names are
plural, corresponding model classes are singular--often trips me up.
 I would never have seen that error on my own.


--
***          E-Mail is NOT a SECURE channel          ***
James B. Byrne                mailto:ByrneJB@Harte-Lyne.ca
Harte & Lyne Limited          http://www.harte-lyne.ca
9 Brockley Drive              vox: +1 905 561 1241
Hamilton, Ontario             fax: +1 905 561 0757
Canada  L8E 3C3


pgsql-general by date:

Previous
From: Robert Treat
Date:
Subject: Re: PGError: ERROR: missing FROM-clause entry for table
Next
From: A B
Date:
Subject: Question about catching exception