Grouping Error w/ Postgresql

I just upgraded Yii, and I started getting this error:

CDbCommand failed to execute the SQL statement: SQLSTATE[42803]: Grouping error: 7 ERROR: column "sample.identifier" must appear in the GROUP BY clause or be used in an aggregate function

I realize this is a Postgresql error, but I was not getting it in my code before I upgraded, so I assume something must have changed with the way relational a/r handles grouping.

Here is the setup for the query:

				array(


					'sampleRequiredMeasurement' =>


						array(


							'select' => 'id',


							'condition'=>'"sourceLabId" != 1 AND "sampleMeasurementId" IS NULL',


							'group' => 'sample.id'


							),


					'sampleRequiredMeasurement' =>


						array(


							'select' => '*',


							'condition'=>'"sourceLabId" = :sourceLabId AND "sampleMeasurementId" IS NULL',


							'params' => array(':sourceLabId' => $_GET['sourceLabId']),


							'group' => 'sample.id'


							),


					'sampleActionMassUpdateLog' =>


						array(


							'select' => 'actionName',


							'on' => ' ( "actionName" = 'adminExternalLabShipments' )',


							'condition' => '??."actionName" ' . $nullness,


						),


				)


			);

Of course when I comment out the grouping, I get no errors. Also I am doing a

model()->with( $joins )->together()->findAll();

where $joins is the array above. Any ideas on how to resolve?

Thanks!

I figured out why it broke with the upgrade – the older version grouped incorrectly so it never got the error in the first place. It just seemed to work because the small test data I was using just so happened to line out perfectly.

So, there is not a group by "error", although A/R joins with grouping do not work on postgresql very easily.

On a side note, I found another issue with the new db stuff: there is a memory leak somewhere. On page that previously loaded fine, I get an out of memory error now. It is a page that shows 50 rows with maybe 15 columns each, and each row runs 3-4 A/R join with()->together() queries. Please let me know how to dig in to this more and I will see what I can find!

What is the memory limit you set?