Re: table synonyms

Поиск
Список
Период
Сортировка
От Neil Dugan
Тема Re: table synonyms
Дата
Msg-id 1117328923.4709.12.camel@localhost.localdomain
обсуждение исходный текст
Ответ на Re: table synonyms  (Tino Wildenhain <tino@wildenhain.de>)
Список pgsql-general
On Tue, 2005-05-24 at 19:48 +0200, Tino Wildenhain wrote:
> Am Dienstag, den 24.05.2005, 13:49 -0300 schrieb jjeffman@cpovo.net:
> > It will be a very pleasant idea. Although I am
> > an application developer I don't know if I have
> > enough knowledge to do that. Do you know how could
> > I help the PostgreSQL development ?
> >
> > Another feature I missed is the "returning" clause
> > of the Oracle "INSERT" SQL command, which allow the
> > user to retrieve the "serial" value after an insert
> > command, which works even in a concurrent network
> > environment.
>
> INSERT INTO table (...) values (...);
> SELECT currval('table_id_seq');
>
> See documentation for sequences.
>

At times when I have been using a serial number of one table as a link
for another.  I have set the 'id' field to a type bigint then used the
code below

SELECT nexval('table_id_seq');
number = result;
INSERT INTO table (id,...) values (number,...);

Then used the value in 'number' for other queries.  If two users do the
same query at the same time they both get different values and each wont
get confused as to who used what value.

>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match


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

Предыдущее
От: "Mohan, Ross"
Дата:
Сообщение: Re: Fast request for version checking....
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Fast request for version checking....