Re: Last inserted id

Поиск
Список
Период
Сортировка
От Dave Page
Тема Re: Last inserted id
Дата
Msg-id AA30E7BCCA5C1D4E88A231900F8325C00C70@dogbert.vale-housing.co.uk
обсуждение исходный текст
Ответ на Last inserted id  ("Simeo Reig" <simreig@terra.es>)
Ответы Re: Last inserted id  ("Geoffrey D. Bennett" <g@netcraft.com.au>)
Список pgsql-odbc

> -----Original Message-----
> From: Simeo Reig [mailto:simreig@terra.es]
> Sent: 11 November 2001 22:54
> To: Dave Page
> Subject: Re: [ODBC] Last inserted id
>
>
> I had think that the problem was this but I believed that
> was possible to make a mistake because I'm newer with
> ADO. What must I do ? I see two possibilities:
>
>  A) Make a select NEXTVAL from sequence, and
>       insert this value in the id
>
>   B) Insert row and after make a CURRVAL
>
> What option Do you use ?

Use option A), it's multi-user safe whereas the other method isn't.

>
> Another question please : Are you pleased with Postgres ?
> I have to make a project with almost 50 tables (five with
> arround 100.000 rows), and 20 concurrent users. Can postgres
> make a good job?

I'm project lead for pgAdmin II (pgadmin.postgresql.org) so I'm probably a
bit biased :-) but the main server I run at work hosts about 12 databases
for interactive (VB) applications, PHP apps and also logs data from 3 PBXs.
Most of the databases have at least 10 tables in them (a couple have about
40) and I have some tables over 1.7 million rows. In short, PostgreSQL does
a great job for me and I use it wherever I can (incidently, I also have
Informix, MS-SQL & Unidata servers here which I could have used instead of
PostgreSQL).

Regards, Dave.


> Thanks Dave
>
> Simeó Reig
> Barcelona (Spain)
>
> > ADO doesn't re-query the database to get the true
> >representation of
> > the
> new
> > row. The common way around this problem is to manually >get
> the new ID
> first
> > in a seperate query, and then insert that value as well. The >other
> > alternative is to refresh the recordset after the insert, >however
> > this
> often
> > isn't desirable.
> >
> > Regards, Dave.
>
>
>

В списке pgsql-odbc по дате отправления:

Предыдущее
От: Hiroshi Inoue
Дата:
Сообщение: Re: Large Objects; ODBC & Transactions
Следующее
От: "Geoffrey D. Bennett"
Дата:
Сообщение: Re: Last inserted id