pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Ellerbrock <richarde@eskom.co.za>
To: chriskl@familyhealth.com.au
Cc: pgsql-sql@postgresql.org
Subject: Re: REPOST: Trouble with SQL conversion
Date: Thu, 11 Apr 2002 17:48:02 +0200
Message-ID: <scb5cc57.078@eskom.co.za> (raw)

Ok, now the academic part - why do you have to "GROUP BY" all columns
selected? Would one not suffice and have the optimizer figure out the
rest? I am no standards guru and have not studied SQL92 or SQL99 so
would just like to know.

Another inconsistency that I have picked up is with transactions. If I
insert a record and violate a primary key (in a transaction block, on
both databases) I get an error to the fact - correct. After the error, I
am not allowed to do anything, even a select. I am trying to simulate a
replace into the database, but using an insert, if failure update does
not work. I have worked around this by first trying an update, check the
number of affected rows, if zero then insert. This works.

So my question: If an insert fails in a transaction is all access dead
forever, even selects till the transaction is rolled back or committed?
Once again what does the standard say.

>>> Christopher Kings-Lynne <chriskl@familyhealth.com.au> 2002/04/11
05:36:12 >>>
> I am an idiot! Actually your suggestion does work - it would help to
do
> it against a customer that actually has records!

Phew!  Lucky that "other" database didn't have one over us, huh? ;)

Chris





view thread (6+ messages)

Message-ID: <scb5cc57.078@eskom.co.za>
Permalink:  ../scb5cc57.078@eskom.co.za/
Also on:    postgresql.org/message-id/scb5cc57.078@eskom.co.za

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: richarde@eskom.co.za, chriskl@familyhealth.com.au
  Subject: Re: REPOST: Trouble with SQL conversion
  In-Reply-To: <scb5cc57.078@eskom.co.za>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox