On Thu, Jun 20, 2013 at 03:13:40PM -0400, Bill McGonigle wrote:
> but then, onto the full statement, as a SELECT instead of DELETE for
> investigation purposes, and I get:
> 
> ecommerce=# SELECT count(txntime) FROM
> bucardo.delta_public_saved_cart USING (SELECT txntime AS tt FROM
> bucardo.track_public_saved_cart GROUP BY 1) AS foo WHERE txntime =
> tt AND txntime < now() - interval '45 seconds';
> ERROR:  syntax error at or near "USING"
> LINE 1: ...unt(txntime) FROM bucardo.delta_public_saved_cart USING (SEL...
> 
> I can't seem to find documentation about using 'USING' without a
> JOIN (is it implicit?).
> 
> These are on v8.4 - I'm wondering if either of these might behave
> differently on v9.  Equally as likely I'm missing something.

"USING" is DELETE's way of specifying a cross join, so if you wanted to change
that DELETE statement into a SELECT, you'd have to do more than just change
DELETE to SELECT count(whatever). You might try instead to append "RETURNING
<something>" to the DELETE statement, and doing it all within a transaction
that you eventually roll back. That will prevent you from actually deleting
anything, and still let you get results from the query.

-- 
Josh Tolley   [email protected]   801-987-0252
End Point Corporation  http://www.endpoint.com

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Bucardo-general mailing list
[email protected]
https://mail.endcrypt.com/mailman/listinfo/bucardo-general

Reply via email to