I got this error when searching products by keyword in the admin sidebar
and shop front search bar. I am on Spree 1.1.4. Rails 3.2.9.

Started GET
"/products?utf8=%E2%9C%93&keywords=Ruby+on+Rails+Jr.+Spaghetti&taxon=" for
127.0.0.1 at 2012-12-26 20:09:12 +1300
Processing by Spree::ProductsController#index as HTML
Parameters: {"utf8"=>"✓", "keywords"=>"Ruby on Rails Jr. Spaghetti",
"taxon"=>""}
Spree::Preference Exists (0.4ms) SELECT 1 AS one FROM
"spree_preferences" WHERE "spree_preferences"."key" =
'spree/app_configuration/default_locale' LIMIT 1
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM
"spree_preferences" WHERE "spree_preferences"."name" = 'default_locale'
LIMIT 1
CACHE (0.0ms) SELECT 1 AS one FROM "spree_preferences" WHERE
"spree_preferences"."key" = 'spree/app_configuration/default_locale' LIMIT 1
CACHE (0.0ms) SELECT "spree_preferences".* FROM "spree_preferences"
WHERE "spree_preferences"."name" = 'default_locale' LIMIT 1
Spree::User Load (0.5ms) SELECT "spree_users".* FROM "spree_users" WHERE
"spree_users"."id" = 19 LIMIT 1
Spree::Order Load (0.4ms) SELECT "spree_orders".* FROM "spree_orders"
WHERE "spree_orders"."user_id" = 19 AND "spree_orders"."completed_at" IS
NULL ORDER BY created_at ASC LIMIT 1
Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM
"spree_taxonomies" INNER JOIN "spree_taxons" ON
"spree_taxons"."taxonomy_id" = "spree_taxonomies"."id" AND
"spree_taxons"."parent_id" IS NULL WHERE (spree_taxonomies.is_main is true)
LIMIT 1
Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM
"spree_preferences" WHERE "spree_preferences"."key" =
'spree/app_configuration/products_per_page' LIMIT 1
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM
"spree_preferences" WHERE "spree_preferences"."name" = 'products_per_page'
LIMIT 1
Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM
"spree_preferences" WHERE "spree_preferences"."key" =
'spree/app_configuration/layout' LIMIT 1
Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM
"spree_preferences" WHERE "spree_preferences"."name" = 'layout' LIMIT 1
Deface: 1 overrides found for 'spree/layouts/spree_application'
Deface: 'add_analytics_header' matched 1 times with 'head'
Deface: [ERROR] The original source for 'add_analytics_header' has changed,
this override should be reviewed to ensure it's still valid.
Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM
"spree_taxonomies" WHERE (spree_taxonomies.is_main is true) LIMIT 1
Rendered spree/shared/_taxonomies.html.erb (1.0ms)
(1.4ms) SELECT COUNT(DISTINCT "spree_products"."id") AS count_id,
spree_products.id AS spree_products_id, spree_products.name AS
spree_products_name, spree_products.description AS
spree_products_description, spree_products.available_on AS
spree_products_available_on, spree_products.deleted_at AS
spree_products_deleted_at, spree_products.permalink AS
spree_products_permalink, spree_products.meta_description AS
spree_products_meta_description, spree_products.meta_keywords AS
spree_products_meta_keywords, spree_products.tax_category_id AS
spree_products_tax_category_id, spree_products.shipping_category_id AS
spree_products_shipping_category_id, spree_products.created_at AS
spree_products_created_at, spree_products.updated_at AS
spree_products_updated_at, spree_products.count_on_hand AS
spree_products_count_on_hand FROM "spree_products" LEFT OUTER JOIN
"spree_variants" ON "spree_variants"."product_id" = "spree_products"."id"
AND "spree_variants"."is_master" = 't' WHERE "spree_products"."deleted_at"
IS NULL AND ("spree_products".available_on <= '2012-12-26 07:09:12.240705')
AND ("spree_products".name ILIKE '%Ruby%' OR "spree_products".name ILIKE
'%on%' OR "spree_products".name ILIKE '%Rails%' OR "spree_products".name
ILIKE '%Jr.%' OR "spree_products".name ILIKE '%Spaghetti%' OR
"spree_products".description ILIKE '%Ruby%' OR "spree_products".description
ILIKE '%on%' OR "spree_products".description ILIKE '%Rails%' OR
"spree_products".description ILIKE '%Jr.%' OR "spree_products".description
ILIKE '%Spaghetti%') GROUP BY spree_products.id, spree_products.name,
spree_products.description, spree_products.available_on,
spree_products.deleted_at, spree_products.permalink,
spree_products.meta_description, spree_products.meta_keywords,
spree_products.tax_category_id, spree_products.shipping_category_id,
spree_products.created_at, spree_products.updated_at,
spree_products.count_on_hand LIMIT 12 OFFSET 0
CACHE (0.0ms) SELECT COUNT(DISTINCT "spree_products"."id") AS count_id,
spree_products.id AS spree_products_id, spree_products.name AS
spree_products_name, spree_products.description AS
spree_products_description, spree_products.available_on AS
spree_products_available_on, spree_products.deleted_at AS
spree_products_deleted_at, spree_products.permalink AS
spree_products_permalink, spree_products.meta_description AS
spree_products_meta_description, spree_products.meta_keywords AS
spree_products_meta_keywords, spree_products.tax_category_id AS
spree_products_tax_category_id, spree_products.shipping_category_id AS
spree_products_shipping_category_id, spree_products.created_at AS
spree_products_created_at, spree_products.updated_at AS
spree_products_updated_at, spree_products.count_on_hand AS
spree_products_count_on_hand FROM "spree_products" LEFT OUTER JOIN
"spree_variants" ON "spree_variants"."product_id" = "spree_products"."id"
AND "spree_variants"."is_master" = 't' WHERE "spree_products"."deleted_at"
IS NULL AND ("spree_products".available_on <= '2012-12-26 07:09:12.240705')
AND ("spree_products".name ILIKE '%Ruby%' OR "spree_products".name ILIKE
'%on%' OR "spree_products".name ILIKE '%Rails%' OR "spree_products".name
ILIKE '%Jr.%' OR "spree_products".name ILIKE '%Spaghetti%' OR
"spree_products".description ILIKE '%Ruby%' OR "spree_products".description
ILIKE '%on%' OR "spree_products".description ILIKE '%Rails%' OR
"spree_products".description ILIKE '%Jr.%' OR "spree_products".description
ILIKE '%Spaghetti%') GROUP BY spree_products.id, spree_products.name,
spree_products.description, spree_products.available_on,
spree_products.deleted_at, spree_products.permalink,
spree_products.meta_description, spree_products.meta_keywords,
spree_products.tax_category_id, spree_products.shipping_category_id,
spree_products.created_at, spree_products.updated_at,
spree_products.count_on_hand LIMIT 12 OFFSET 0
Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM
"spree_taxonomies" WHERE (is_main is true) LIMIT 1
Rendered spree/shared/_taxon_bar.html.erb (0.8ms)
CACHE (0.0ms) SELECT COUNT(DISTINCT "spree_products"."id") AS count_id,
spree_products.id AS spree_products_id, spree_products.name AS
spree_products_name, spree_products.description AS
spree_products_description, spree_products.available_on AS
spree_products_available_on, spree_products.deleted_at AS
spree_products_deleted_at, spree_products.permalink AS
spree_products_permalink, spree_products.meta_description AS
spree_products_meta_description, spree_products.meta_keywords AS
spree_products_meta_keywords, spree_products.tax_category_id AS
spree_products_tax_category_id, spree_products.shipping_category_id AS
spree_products_shipping_category_id, spree_products.created_at AS
spree_products_created_at, spree_products.updated_at AS
spree_products_updated_at, spree_products.count_on_hand AS
spree_products_count_on_hand FROM "spree_products" LEFT OUTER JOIN
"spree_variants" ON "spree_variants"."product_id" = "spree_products"."id"
AND "spree_variants"."is_master" = 't' WHERE "spree_products"."deleted_at"
IS NULL AND ("spree_products".available_on <= '2012-12-26 07:09:12.240705')
AND ("spree_products".name ILIKE '%Ruby%' OR "spree_products".name ILIKE
'%on%' OR "spree_products".name ILIKE '%Rails%' OR "spree_products".name
ILIKE '%Jr.%' OR "spree_products".name ILIKE '%Spaghetti%' OR
"spree_products".description ILIKE '%Ruby%' OR "spree_products".description
ILIKE '%on%' OR "spree_products".description ILIKE '%Rails%' OR
"spree_products".description ILIKE '%Jr.%' OR "spree_products".description
ILIKE '%Spaghetti%') GROUP BY spree_products.id, spree_products.name,
spree_products.description, spree_products.available_on,
spree_products.deleted_at, spree_products.permalink,
spree_products.meta_description, spree_products.meta_keywords,
spree_products.tax_category_id, spree_products.shipping_category_id,
spree_products.created_at, spree_products.updated_at,
spree_products.count_on_hand LIMIT 12 OFFSET 0
SQL (0.8ms) SELECT "spree_products"."id" AS t0_r0,
"spree_products"."name" AS t0_r1, "spree_products"."description" AS t0_r2,
"spree_products"."available_on" AS t0_r3, "spree_products"."deleted_at" AS
t0_r4, "spree_products"."permalink" AS t0_r5,
"spree_products"."meta_description" AS t0_r6,
"spree_products"."meta_keywords" AS t0_r7,
"spree_products"."tax_category_id" AS t0_r8,
"spree_products"."shipping_category_id" AS t0_r9,
"spree_products"."created_at" AS t0_r10, "spree_products"."updated_at" AS
t0_r11, "spree_products"."count_on_hand" AS t0_r12, "spree_variants"."id"
AS t1_r0, "spree_variants"."sku" AS t1_r1, "spree_variants"."price" AS
t1_r2, "spree_variants"."weight" AS t1_r3, "spree_variants"."height" AS
t1_r4, "spree_variants"."width" AS t1_r5, "spree_variants"."depth" AS
t1_r6, "spree_variants"."deleted_at" AS t1_r7, "spree_variants"."is_master"
AS t1_r8, "spree_variants"."product_id" AS t1_r9,
"spree_variants"."count_on_hand" AS t1_r10, "spree_variants"."cost_price"
AS t1_r11, "spree_variants"."position" AS t1_r12,
"spree_variants"."price_2" AS t1_r13,
"spree_variants"."reorder_automatically" AS t1_r14,
"spree_variants"."minimum_on_hand" AS t1_r15,
"spree_variants"."minimum_reorder_size" AS t1_r16,
"spree_variants"."reorder_method" AS t1_r17 FROM "spree_products" LEFT
OUTER JOIN "spree_variants" ON "spree_variants"."product_id" =
"spree_products"."id" AND "spree_variants"."is_master" = 't' WHERE
"spree_products"."deleted_at" IS NULL AND ("spree_products".available_on <=
'2012-12-26 07:09:12.240705') AND ("spree_products".name ILIKE '%Ruby%' OR
"spree_products".name ILIKE '%on%' OR "spree_products".name ILIKE '%Rails%'
OR "spree_products".name ILIKE '%Jr.%' OR "spree_products".name ILIKE
'%Spaghetti%' OR "spree_products".description ILIKE '%Ruby%' OR
"spree_products".description ILIKE '%on%' OR "spree_products".description
ILIKE '%Rails%' OR "spree_products".description ILIKE '%Jr.%' OR
"spree_products".description ILIKE '%Spaghetti%') GROUP BY
spree_products.id, spree_products.name, spree_products.description,
spree_products.available_on, spree_products.deleted_at,
spree_products.permalink, spree_products.meta_description,
spree_products.meta_keywords, spree_products.tax_category_id,
spree_products.shipping_category_id, spree_products.created_at,
spree_products.updated_at, spree_products.count_on_hand LIMIT 12 OFFSET 0
PG::Error: ERROR: column "spree_variants.id" must appear in the GROUP BY
clause or be used in an aggregate function
LINE 1: ..._r11, "spree_products"."count_on_hand" AS t0_r12, "spree_var...
^
: SELECT "spree_products"."id" AS t0_r0, "spree_products"."name" AS t0_r1,
"spree_products"."description" AS t0_r2, "spree_products"."available_on" AS
t0_r3, "spree_products"."deleted_at" AS t0_r4, "spree_products"."permalink"
AS t0_r5, "spree_products"."meta_description" AS t0_r6,
"spree_products"."meta_keywords" AS t0_r7,
"spree_products"."tax_category_id" AS t0_r8,
"spree_products"."shipping_category_id" AS t0_r9,
"spree_products"."created_at" AS t0_r10, "spree_products"."updated_at" AS
t0_r11, "spree_products"."count_on_hand" AS t0_r12, "spree_variants"."id"
AS t1_r0, "spree_variants"."sku" AS t1_r1, "spree_variants"."price" AS
t1_r2, "spree_variants"."weight" AS t1_r3, "spree_variants"."height" AS
t1_r4, "spree_variants"."width" AS t1_r5, "spree_variants"."depth" AS
t1_r6, "spree_variants"."deleted_at" AS t1_r7, "spree_variants"."is_master"
AS t1_r8, "spree_variants"."product_id" AS t1_r9,
"spree_variants"."count_on_hand" AS t1_r10, "spree_variants"."cost_price"
AS t1_r11, "spree_variants"."position" AS t1_r12,
"spree_variants"."price_2" AS t1_r13,
"spree_variants"."reorder_automatically" AS t1_r14,
"spree_variants"."minimum_on_hand" AS t1_r15,
"spree_variants"."minimum_reorder_size" AS t1_r16,
"spree_variants"."reorder_method" AS t1_r17 FROM "spree_products" LEFT
OUTER JOIN "spree_variants" ON "spree_variants"."product_id" =
"spree_products"."id" AND "spree_variants"."is_master" = 't' WHERE
"spree_products"."deleted_at" IS NULL AND ("spree_products".available_on <=
'2012-12-26 07:09:12.240705') AND ("spree_products".name ILIKE '%Ruby%' OR
"spree_products".name ILIKE '%on%' OR "spree_products".name ILIKE '%Rails%'
OR "spree_products".name ILIKE '%Jr.%' OR "spree_products".name ILIKE
'%Spaghetti%' OR "spree_products".description ILIKE '%Ruby%' OR
"spree_products".description ILIKE '%on%' OR "spree_products".description
ILIKE '%Rails%' OR "spree_products".description ILIKE '%Jr.%' OR
"spree_products".description ILIKE '%Spaghetti%') GROUP BY
spree_products.id, spree_products.name, spree_products.description,
spree_products.available_on, spree_products.deleted_at,
spree_products.permalink, spree_products.meta_description,
spree_products.meta_keywords, spree_products.tax_category_id,
spree_products.shipping_category_id, spree_products.created_at,
spree_products.updated_at, spree_products.count_on_hand LIMIT 12 OFFSET 0
Rendered spree/shared/_product_list.html.erb (2.3ms)
Rendered spree/shared/_products.html.erb (9.6ms)
Rendered spree/products/index.html.erb within
spree/layouts/spree_application (16.0ms)
Completed 500 Internal Server Error in 33ms

ActionView::Template::Error (PG::Error: ERROR: column "spree_variants.id"
must appear in the GROUP BY clause or be used in an aggregate function
LINE 1: ..._r11, "spree_products"."count_on_hand" AS t0_r12, "spree_var...
^
: SELECT "spree_products"."id" AS t0_r0, "spree_products"."name" AS t0_r1,
"spree_products"."description" AS t0_r2, "spree_products"."available_on" AS
t0_r3, "spree_products"."deleted_at" AS t0_r4, "spree_products"."permalink"
AS t0_r5, "spree_products"."meta_description" AS t0_r6,
"spree_products"."meta_keywords" AS t0_r7,
"spree_products"."tax_category_id" AS t0_r8,
"spree_products"."shipping_category_id" AS t0_r9,
"spree_products"."created_at" AS t0_r10, "spree_products"."updated_at" AS
t0_r11, "spree_products"."count_on_hand" AS t0_r12, "spree_variants"."id"
AS t1_r0, "spree_variants"."sku" AS t1_r1, "spree_variants"."price" AS
t1_r2, "spree_variants"."weight" AS t1_r3, "spree_variants"."height" AS
t1_r4, "spree_variants"."width" AS t1_r5, "spree_variants"."depth" AS
t1_r6, "spree_variants"."deleted_at" AS t1_r7, "spree_variants"."is_master"
AS t1_r8, "spree_variants"."product_id" AS t1_r9,
"spree_variants"."count_on_hand" AS t1_r10, "spree_variants"."cost_price"
AS t1_r11, "spree_variants"."position" AS t1_r12,
"spree_variants"."price_2" AS t1_r13,
"spree_variants"."reorder_automatically" AS t1_r14,
"spree_variants"."minimum_on_hand" AS t1_r15,
"spree_variants"."minimum_reorder_size" AS t1_r16,
"spree_variants"."reorder_method" AS t1_r17 FROM "spree_products" LEFT
OUTER JOIN "spree_variants" ON "spree_variants"."product_id" =
"spree_products"."id" AND "spree_variants"."is_master" = 't' WHERE
"spree_products"."deleted_at" IS NULL AND ("spree_products".available_on <=
'2012-12-26 07:09:12.240705') AND ("spree_products".name ILIKE '%Ruby%' OR
"spree_products".name ILIKE '%on%' OR "spree_products".name ILIKE '%Rails%'
OR "spree_products".name ILIKE '%Jr.%' OR "spree_products".name ILIKE
'%Spaghetti%' OR "spree_products".description ILIKE '%Ruby%' OR
"spree_products".description ILIKE '%on%' OR "spree_products".description
ILIKE '%Rails%' OR "spree_products".description ILIKE '%Jr.%' OR
"spree_products".description ILIKE '%Spaghetti%') GROUP BY
spree_products.id, spree_products.name, spree_products.description,
spree_products.available_on, spree_products.deleted_at,
spree_products.permalink, spree_products.meta_description,
spree_products.meta_keywords, spree_products.tax_category_id,
spree_products.shipping_category_id, spree_products.created_at,
spree_products.updated_at, spree_products.count_on_hand LIMIT 12 OFFSET 0):

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/gau1idmFYnwJ.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

Search Discussions

  • Jianbo cui at Dec 26, 2012 at 7:13 am
    "Ruby on Rails Jr. Spaghetti" will cause the error and "Ruby on Rails Jr
    Spaghetti " without the dot works.


    On Wednesday, December 26, 2012 8:10:28 PM UTC+13, jianbo cui wrote:

    I got this error when searching products by keyword in the admin sidebar
    and shop front search bar. I am on Spree 1.1.4. Rails 3.2.9.

    Started GET
    "/products?utf8=%E2%9C%93&keywords=Ruby+on+Rails+Jr.+Spaghetti&taxon=" for
    127.0.0.1 at 2012-12-26 20:09:12 +1300
    Processing by Spree::ProductsController#index as HTML
    Parameters: {"utf8"=>"✓", "keywords"=>"Ruby on Rails Jr. Spaghetti",
    "taxon"=>""}
    Spree::Preference Exists (0.4ms) SELECT 1 AS one FROM
    "spree_preferences" WHERE "spree_preferences"."key" =
    'spree/app_configuration/default_locale' LIMIT 1
    Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM
    "spree_preferences" WHERE "spree_preferences"."name" = 'default_locale'
    LIMIT 1
    CACHE (0.0ms) SELECT 1 AS one FROM "spree_preferences" WHERE
    "spree_preferences"."key" = 'spree/app_configuration/default_locale' LIMIT 1
    CACHE (0.0ms) SELECT "spree_preferences".* FROM "spree_preferences"
    WHERE "spree_preferences"."name" = 'default_locale' LIMIT 1
    Spree::User Load (0.5ms) SELECT "spree_users".* FROM "spree_users"
    WHERE "spree_users"."id" = 19 LIMIT 1
    Spree::Order Load (0.4ms) SELECT "spree_orders".* FROM "spree_orders"
    WHERE "spree_orders"."user_id" = 19 AND "spree_orders"."completed_at" IS
    NULL ORDER BY created_at ASC LIMIT 1
    Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM
    "spree_taxonomies" INNER JOIN "spree_taxons" ON
    "spree_taxons"."taxonomy_id" = "spree_taxonomies"."id" AND
    "spree_taxons"."parent_id" IS NULL WHERE (spree_taxonomies.is_main is true)
    LIMIT 1
    Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM
    "spree_preferences" WHERE "spree_preferences"."key" =
    'spree/app_configuration/products_per_page' LIMIT 1
    Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM
    "spree_preferences" WHERE "spree_preferences"."name" = 'products_per_page'
    LIMIT 1
    Spree::Preference Exists (0.3ms) SELECT 1 AS one FROM
    "spree_preferences" WHERE "spree_preferences"."key" =
    'spree/app_configuration/layout' LIMIT 1
    Spree::Preference Load (0.3ms) SELECT "spree_preferences".* FROM
    "spree_preferences" WHERE "spree_preferences"."name" = 'layout' LIMIT 1
    Deface: 1 overrides found for 'spree/layouts/spree_application'
    Deface: 'add_analytics_header' matched 1 times with 'head'
    Deface: [ERROR] The original source for 'add_analytics_header' has
    changed, this override should be reviewed to ensure it's still valid.
    Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM
    "spree_taxonomies" WHERE (spree_taxonomies.is_main is true) LIMIT 1
    Rendered spree/shared/_taxonomies.html.erb (1.0ms)
    (1.4ms) SELECT COUNT(DISTINCT "spree_products"."id") AS count_id,
    spree_products.id AS spree_products_id, spree_products.name AS
    spree_products_name, spree_products.description AS
    spree_products_description, spree_products.available_on AS
    spree_products_available_on, spree_products.deleted_at AS
    spree_products_deleted_at, spree_products.permalink AS
    spree_products_permalink, spree_products.meta_description AS
    spree_products_meta_description, spree_products.meta_keywords AS
    spree_products_meta_keywords, spree_products.tax_category_id AS
    spree_products_tax_category_id, spree_products.shipping_category_id AS
    spree_products_shipping_category_id, spree_products.created_at AS
    spree_products_created_at, spree_products.updated_at AS
    spree_products_updated_at, spree_products.count_on_hand AS
    spree_products_count_on_hand FROM "spree_products" LEFT OUTER JOIN
    "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id"
    AND "spree_variants"."is_master" = 't' WHERE "spree_products"."deleted_at"
    IS NULL AND ("spree_products".available_on <= '2012-12-26 07:09:12.240705')
    AND ("spree_products".name ILIKE '%Ruby%' OR "spree_products".name ILIKE
    '%on%' OR "spree_products".name ILIKE '%Rails%' OR "spree_products".name
    ILIKE '%Jr.%' OR "spree_products".name ILIKE '%Spaghetti%' OR
    "spree_products".description ILIKE '%Ruby%' OR "spree_products".description
    ILIKE '%on%' OR "spree_products".description ILIKE '%Rails%' OR
    "spree_products".description ILIKE '%Jr.%' OR "spree_products".description
    ILIKE '%Spaghetti%') GROUP BY spree_products.id, spree_products.name,
    spree_products.description, spree_products.available_on,
    spree_products.deleted_at, spree_products.permalink,
    spree_products.meta_description, spree_products.meta_keywords,
    spree_products.tax_category_id, spree_products.shipping_category_id,
    spree_products.created_at, spree_products.updated_at,
    spree_products.count_on_hand LIMIT 12 OFFSET 0
    CACHE (0.0ms) SELECT COUNT(DISTINCT "spree_products"."id") AS count_id,
    spree_products.id AS spree_products_id, spree_products.name AS
    spree_products_name, spree_products.description AS
    spree_products_description, spree_products.available_on AS
    spree_products_available_on, spree_products.deleted_at AS
    spree_products_deleted_at, spree_products.permalink AS
    spree_products_permalink, spree_products.meta_description AS
    spree_products_meta_description, spree_products.meta_keywords AS
    spree_products_meta_keywords, spree_products.tax_category_id AS
    spree_products_tax_category_id, spree_products.shipping_category_id AS
    spree_products_shipping_category_id, spree_products.created_at AS
    spree_products_created_at, spree_products.updated_at AS
    spree_products_updated_at, spree_products.count_on_hand AS
    spree_products_count_on_hand FROM "spree_products" LEFT OUTER JOIN
    "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id"
    AND "spree_variants"."is_master" = 't' WHERE "spree_products"."deleted_at"
    IS NULL AND ("spree_products".available_on <= '2012-12-26 07:09:12.240705')
    AND ("spree_products".name ILIKE '%Ruby%' OR "spree_products".name ILIKE
    '%on%' OR "spree_products".name ILIKE '%Rails%' OR "spree_products".name
    ILIKE '%Jr.%' OR "spree_products".name ILIKE '%Spaghetti%' OR
    "spree_products".description ILIKE '%Ruby%' OR "spree_products".description
    ILIKE '%on%' OR "spree_products".description ILIKE '%Rails%' OR
    "spree_products".description ILIKE '%Jr.%' OR "spree_products".description
    ILIKE '%Spaghetti%') GROUP BY spree_products.id, spree_products.name,
    spree_products.description, spree_products.available_on,
    spree_products.deleted_at, spree_products.permalink,
    spree_products.meta_description, spree_products.meta_keywords,
    spree_products.tax_category_id, spree_products.shipping_category_id,
    spree_products.created_at, spree_products.updated_at,
    spree_products.count_on_hand LIMIT 12 OFFSET 0
    Spree::Taxonomy Load (0.4ms) SELECT "spree_taxonomies".* FROM
    "spree_taxonomies" WHERE (is_main is true) LIMIT 1
    Rendered spree/shared/_taxon_bar.html.erb (0.8ms)
    CACHE (0.0ms) SELECT COUNT(DISTINCT "spree_products"."id") AS count_id,
    spree_products.id AS spree_products_id, spree_products.name AS
    spree_products_name, spree_products.description AS
    spree_products_description, spree_products.available_on AS
    spree_products_available_on, spree_products.deleted_at AS
    spree_products_deleted_at, spree_products.permalink AS
    spree_products_permalink, spree_products.meta_description AS
    spree_products_meta_description, spree_products.meta_keywords AS
    spree_products_meta_keywords, spree_products.tax_category_id AS
    spree_products_tax_category_id, spree_products.shipping_category_id AS
    spree_products_shipping_category_id, spree_products.created_at AS
    spree_products_created_at, spree_products.updated_at AS
    spree_products_updated_at, spree_products.count_on_hand AS
    spree_products_count_on_hand FROM "spree_products" LEFT OUTER JOIN
    "spree_variants" ON "spree_variants"."product_id" = "spree_products"."id"
    AND "spree_variants"."is_master" = 't' WHERE "spree_products"."deleted_at"
    IS NULL AND ("spree_products".available_on <= '2012-12-26 07:09:12.240705')
    AND ("spree_products".name ILIKE '%Ruby%' OR "spree_products".name ILIKE
    '%on%' OR "spree_products".name ILIKE '%Rails%' OR "spree_products".name
    ILIKE '%Jr.%' OR "spree_products".name ILIKE '%Spaghetti%' OR
    "spree_products".description ILIKE '%Ruby%' OR "spree_products".description
    ILIKE '%on%' OR "spree_products".description ILIKE '%Rails%' OR
    "spree_products".description ILIKE '%Jr.%' OR "spree_products".description
    ILIKE '%Spaghetti%') GROUP BY spree_products.id, spree_products.name,
    spree_products.description, spree_products.available_on,
    spree_products.deleted_at, spree_products.permalink,
    spree_products.meta_description, spree_products.meta_keywords,
    spree_products.tax_category_id, spree_products.shipping_category_id,
    spree_products.created_at, spree_products.updated_at,
    spree_products.count_on_hand LIMIT 12 OFFSET 0
    SQL (0.8ms) SELECT "spree_products"."id" AS t0_r0,
    "spree_products"."name" AS t0_r1, "spree_products"."description" AS t0_r2,
    "spree_products"."available_on" AS t0_r3, "spree_products"."deleted_at" AS
    t0_r4, "spree_products"."permalink" AS t0_r5,
    "spree_products"."meta_description" AS t0_r6,
    "spree_products"."meta_keywords" AS t0_r7,
    "spree_products"."tax_category_id" AS t0_r8,
    "spree_products"."shipping_category_id" AS t0_r9,
    "spree_products"."created_at" AS t0_r10, "spree_products"."updated_at" AS
    t0_r11, "spree_products"."count_on_hand" AS t0_r12, "spree_variants"."id"
    AS t1_r0, "spree_variants"."sku" AS t1_r1, "spree_variants"."price" AS
    t1_r2, "spree_variants"."weight" AS t1_r3, "spree_variants"."height" AS
    t1_r4, "spree_variants"."width" AS t1_r5, "spree_variants"."depth" AS
    t1_r6, "spree_variants"."deleted_at" AS t1_r7, "spree_variants"."is_master"
    AS t1_r8, "spree_variants"."product_id" AS t1_r9,
    "spree_variants"."count_on_hand" AS t1_r10, "spree_variants"."cost_price"
    AS t1_r11, "spree_variants"."position" AS t1_r12,
    "spree_variants"."price_2" AS t1_r13,
    "spree_variants"."reorder_automatically" AS t1_r14,
    "spree_variants"."minimum_on_hand" AS t1_r15,
    "spree_variants"."minimum_reorder_size" AS t1_r16,
    "spree_variants"."reorder_method" AS t1_r17 FROM "spree_products" LEFT
    OUTER JOIN "spree_variants" ON "spree_variants"."product_id" =
    "spree_products"."id" AND "spree_variants"."is_master" = 't' WHERE
    "spree_products"."deleted_at" IS NULL AND ("spree_products".available_on <=
    '2012-12-26 07:09:12.240705') AND ("spree_products".name ILIKE '%Ruby%' OR
    "spree_products".name ILIKE '%on%' OR "spree_products".name ILIKE '%Rails%'
    OR "spree_products".name ILIKE '%Jr.%' OR "spree_products".name ILIKE
    '%Spaghetti%' OR "spree_products".description ILIKE '%Ruby%' OR
    "spree_products".description ILIKE '%on%' OR "spree_products".description
    ILIKE '%Rails%' OR "spree_products".description ILIKE '%Jr.%' OR
    "spree_products".description ILIKE '%Spaghetti%') GROUP BY
    spree_products.id, spree_products.name, spree_products.description,
    spree_products.available_on, spree_products.deleted_at,
    spree_products.permalink, spree_products.meta_description,
    spree_products.meta_keywords, spree_products.tax_category_id,
    spree_products.shipping_category_id, spree_products.created_at,
    spree_products.updated_at, spree_products.count_on_hand LIMIT 12 OFFSET 0
    PG::Error: ERROR: column "spree_variants.id" must appear in the GROUP BY
    clause or be used in an aggregate function
    LINE 1: ..._r11, "spree_products"."count_on_hand" AS t0_r12, "spree_var...
    ^
    : SELECT "spree_products"."id" AS t0_r0, "spree_products"."name" AS
    t0_r1, "spree_products"."description" AS t0_r2,
    "spree_products"."available_on" AS t0_r3, "spree_products"."deleted_at" AS
    t0_r4, "spree_products"."permalink" AS t0_r5,
    "spree_products"."meta_description" AS t0_r6,
    "spree_products"."meta_keywords" AS t0_r7,
    "spree_products"."tax_category_id" AS t0_r8,
    "spree_products"."shipping_category_id" AS t0_r9,
    "spree_products"."created_at" AS t0_r10, "spree_products"."updated_at" AS
    t0_r11, "spree_products"."count_on_hand" AS t0_r12, "spree_variants"."id"
    AS t1_r0, "spree_variants"."sku" AS t1_r1, "spree_variants"."price" AS
    t1_r2, "spree_variants"."weight" AS t1_r3, "spree_variants"."height" AS
    t1_r4, "spree_variants"."width" AS t1_r5, "spree_variants"."depth" AS
    t1_r6, "spree_variants"."deleted_at" AS t1_r7, "spree_variants"."is_master"
    AS t1_r8, "spree_variants"."product_id" AS t1_r9,
    "spree_variants"."count_on_hand" AS t1_r10, "spree_variants"."cost_price"
    AS t1_r11, "spree_variants"."position" AS t1_r12,
    "spree_variants"."price_2" AS t1_r13,
    "spree_variants"."reorder_automatically" AS t1_r14,
    "spree_variants"."minimum_on_hand" AS t1_r15,
    "spree_variants"."minimum_reorder_size" AS t1_r16,
    "spree_variants"."reorder_method" AS t1_r17 FROM "spree_products" LEFT
    OUTER JOIN "spree_variants" ON "spree_variants"."product_id" =
    "spree_products"."id" AND "spree_variants"."is_master" = 't' WHERE
    "spree_products"."deleted_at" IS NULL AND ("spree_products".available_on <=
    '2012-12-26 07:09:12.240705') AND ("spree_products".name ILIKE '%Ruby%' OR
    "spree_products".name ILIKE '%on%' OR "spree_products".name ILIKE '%Rails%'
    OR "spree_products".name ILIKE '%Jr.%' OR "spree_products".name ILIKE
    '%Spaghetti%' OR "spree_products".description ILIKE '%Ruby%' OR
    "spree_products".description ILIKE '%on%' OR "spree_products".description
    ILIKE '%Rails%' OR "spree_products".description ILIKE '%Jr.%' OR
    "spree_products".description ILIKE '%Spaghetti%') GROUP BY
    spree_products.id, spree_products.name, spree_products.description,
    spree_products.available_on, spree_products.deleted_at,
    spree_products.permalink, spree_products.meta_description,
    spree_products.meta_keywords, spree_products.tax_category_id,
    spree_products.shipping_category_id, spree_products.created_at,
    spree_products.updated_at, spree_products.count_on_hand LIMIT 12 OFFSET 0
    Rendered spree/shared/_product_list.html.erb (2.3ms)
    Rendered spree/shared/_products.html.erb (9.6ms)
    Rendered spree/products/index.html.erb within
    spree/layouts/spree_application (16.0ms)
    Completed 500 Internal Server Error in 33ms

    ActionView::Template::Error (PG::Error: ERROR: column "spree_variants.id"
    must appear in the GROUP BY clause or be used in an aggregate function
    LINE 1: ..._r11, "spree_products"."count_on_hand" AS t0_r12, "spree_var...
    ^
    : SELECT "spree_products"."id" AS t0_r0, "spree_products"."name" AS
    t0_r1, "spree_products"."description" AS t0_r2,
    "spree_products"."available_on" AS t0_r3, "spree_products"."deleted_at" AS
    t0_r4, "spree_products"."permalink" AS t0_r5,
    "spree_products"."meta_description" AS t0_r6,
    "spree_products"."meta_keywords" AS t0_r7,
    "spree_products"."tax_category_id" AS t0_r8,
    "spree_products"."shipping_category_id" AS t0_r9,
    "spree_products"."created_at" AS t0_r10, "spree_products"."updated_at" AS
    t0_r11, "spree_products"."count_on_hand" AS t0_r12, "spree_variants"."id"
    AS t1_r0, "spree_variants"."sku" AS t1_r1, "spree_variants"."price" AS
    t1_r2, "spree_variants"."weight" AS t1_r3, "spree_variants"."height" AS
    t1_r4, "spree_variants"."width" AS t1_r5, "spree_variants"."depth" AS
    t1_r6, "spree_variants"."deleted_at" AS t1_r7, "spree_variants"."is_master"
    AS t1_r8, "spree_variants"."product_id" AS t1_r9,
    "spree_variants"."count_on_hand" AS t1_r10, "spree_variants"."cost_price"
    AS t1_r11, "spree_variants"."position" AS t1_r12,
    "spree_variants"."price_2" AS t1_r13,
    "spree_variants"."reorder_automatically" AS t1_r14,
    "spree_variants"."minimum_on_hand" AS t1_r15,
    "spree_variants"."minimum_reorder_size" AS t1_r16,
    "spree_variants"."reorder_method" AS t1_r17 FROM "spree_products" LEFT
    OUTER JOIN "spree_variants" ON "spree_variants"."product_id" =
    "spree_products"."id" AND "spree_variants"."is_master" = 't' WHERE
    "spree_products"."deleted_at" IS NULL AND ("spree_products".available_on <=
    '2012-12-26 07:09:12.240705') AND ("spree_products".name ILIKE '%Ruby%' OR
    "spree_products".name ILIKE '%on%' OR "spree_products".name ILIKE '%Rails%'
    OR "spree_products".name ILIKE '%Jr.%' OR "spree_products".name ILIKE
    '%Spaghetti%' OR "spree_products".description ILIKE '%Ruby%' OR
    "spree_products".description ILIKE '%on%' OR "spree_products".description
    ILIKE '%Rails%' OR "spree_products".description ILIKE '%Jr.%' OR
    "spree_products".description ILIKE '%Spaghetti%') GROUP BY
    spree_products.id, spree_products.name, spree_products.description,
    spree_products.available_on, spree_products.deleted_at,
    spree_products.permalink, spree_products.meta_description,
    spree_products.meta_keywords, spree_products.tax_category_id,
    spree_products.shipping_category_id, spree_products.created_at,
    spree_products.updated_at, spree_products.count_on_hand LIMIT 12 OFFSET 0):
    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/OFR0FJK-nUYJ.
    To post to this group, send email to spree-user@googlegroups.com.
    To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.
  • Jianbo cui at Dec 26, 2012 at 7:20 am
    After switching back to mysql everything works, is there a fix for postgres?

    --
    You received this message because you are subscribed to the Google Groups "Spree" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/m76b4kOmwT0J.
    To post to this group, send email to spree-user@googlegroups.com.
    To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupspree-user @
categoriesrubyonrails
postedDec 26, '12 at 7:10a
activeDec 26, '12 at 7:20a
posts3
users1
websitespreecommerce.com
irc#RubyOnRails

1 user in discussion

Jianbo cui: 3 posts

People

Translate

site design / logo © 2022 Grokbase