Re: better way?
- From: Pet <petshmidt@xxxxxxxxxxxxxx>
- Date: Wed, 12 Aug 2009 00:49:50 -0700 (PDT)
On 12 Aug., 09:14, Dennis Lee Bieber <wlfr...@xxxxxxxxxxxxx> wrote:
On Tue, 11 Aug 2009 11:45:50 -0700 (PDT), Pet <petshm...@xxxxxxxxxxxxxx>
declaimed the following in gmane.comp.python.general:
Oh, forgotten to mention. It's PostGres
Really? There are still installations of an RDBMS that predates the
commonalization of SQL?
I suspect you mean PostgreSQL -- it IS a different beast from the
older Postgres.
O, yeah. Of course it is PostgreSQL
In either event -- my old books don't show an "all in one" solution.
Best answer is probably to create some stored procedures which you
call instead of plain INSERT; the stored procedure could then do
whatever is needed to check for a duplicate (actually the easiest, I'd
think, would be: if primary key is supplied, it is an UPDATE; if primary
key is NULL or not supplied, it is an insert and the primary key will be
auto-generated).
I don't really like the idea of stored procedure, because query would
depend on existence of it then. On the other side, it looks like best
option.
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfr...@xxxxxxxxxxxxx HTTP://wlfraed.home.netcom.com/
.
- References:
- better way?
- From: someone
- Re: better way?
- From: Kushal Kumaran
- Re: better way?
- From: Pet
- better way?
- Prev by Date: Re: Unrecognized escape sequences in string literals
- Next by Date: Re: httplib incredibly slow :-(
- Previous by thread: Re: better way?
- Next by thread: GOZERBOT 0.9.1 released
- Index(es):
Relevant Pages
|