Re: Proposal: RETURNING primary_key()

Поиск
Список
Период
Сортировка
От Igal @ Lucee.org
Тема Re: Proposal: RETURNING primary_key()
Дата
Msg-id 56DDE9CE.3000006@lucee.org
обсуждение исходный текст
Ответ на Re: Proposal: RETURNING primary_key()  ("Joshua D. Drake" <jd@commandprompt.com>)
Ответы Re: Proposal: RETURNING primary_key()  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 3/7/2016 12:45 PM, Joshua D. Drake wrote:
>
> I agree that the problem is that you don't always know what the 
> primary key is.
>
> I would argue the solution is to check before you write the query.

Sure, that would be great, but perhaps I should have give some more context:

We have an application server which allows our developers to query 
databases with simplified syntax.  Our code is written in a generic way 
to allow the developers that use our application server to pass whatever 
query they want into the database server, whether it's SQL Server, 
MySQL, Oracle, etc.

The code that we use to wrap the SQL statement, as well as the JDBC 
code, has no idea about the table or its constraints, so it's not like 
I'm writing my own queries, and am just being lazy at checking what the 
primary key is.  I just can't know what the developer has in his database.

Sure, I can probably query it via metadata tables, etc., but that would 
be a much slower process.


Igal



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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Proposal: RETURNING primary_key()
Следующее
От: Dmitrii Golub
Дата:
Сообщение: Re: unexpected result from to_tsvector