Thread: safely increase a single column integer value

safely increase a single column integer value

From
Anton Andreev
Date:
Hi,

What is the best way from concurrency point of view to increase a
integer value from a table?

Suppose you count every postback from all the users that are currently
browsing your web-site.

Cheers,
Anton


for libpq which include defines the type oids

From
Samantha Atkins
Date:
I am probably overlooking something but where exactly are these found
for inclusion is libpq based programs? Poking around my installation
doesn't make it obvious.

- samantha


Re: for libpq which include defines the type oids

From
"Pavel Stehule"
Date:
On 06/11/2007, Samantha Atkins <sjatkins@mac.com> wrote:
> I am probably overlooking something but where exactly are these found
> for inclusion is libpq based programs? Poking around my installation
> doesn't make it obvious.
>
> - samantha
>
>

Get oids dynamically. Use static oids on client part isn't good idea.
They can by changed and than you have to recompile your application.,

postgres=# select 'integer'::regtype::int;
 int4
------
   23
(1 row)

Regards
Pavel Stehule