Re: libpq-fe: how to determine unique collision ?

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: libpq-fe: how to determine unique collision ?
Дата
Msg-id Pine.LNX.4.30.0101041706440.1245-100000@peter.localdomain
обсуждение исходный текст
Ответ на libpq-fe: how to determine unique collision ?  (Marc SCHAEFER <schaefer@alphanet.ch>)
Ответы Re: libpq-fe: how to determine unique collision ?
Список pgsql-general
Marc SCHAEFER writes:

>    - how do you detect the error `Can't insert tuple because duplicate' ?

if (strcmp(PQerrorMessage(conn), "ERROR:  Can't insert tuple because duplicate") == 0) {
    panic();
}

I know it's not ideal, but it's about the best you can do.

>
>    - how do you get the OID of an insertion

PQoidValue()

> (the goal being to get
>      the value for the SERIAL type, in order to do something with it)  ?

Serial values and oids are not related.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: 7.0.3 rpm testing & other problems
Следующее
От: Nelio Alves Pereira Filho
Дата:
Сообщение: M$ Visio (ODBC) and Postgres