Doesn't the following allow a race condition?
>declare foo record;
>begin
> select into foo * from overview...
> if not found
> insert...
> else ...
> end if;
>end;
ISTM 2 or more clients could attempt to insert the same row, based on the select
failing, if all were issued at the same time.
>You may want to use persistent connections, also.
Almost certainly you don't. The discussion sites are full of complaints that it
doesn't work properly. There is a tendency for the connections to not get reused, but
not released, either, such that you quickly run out of connections. This is
The answer is easy, but not welcome. The PHP you are using was compiled without
PostgreSQL support. It must be recompiled to include it.
Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at
http://www.eudoramail.com
The answer is easy, but not welcome. The PHP you are using was compiled without
PostgreSQL support. It must be recompiled to include it.
Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at
http://www.eudoramail.com
>> It's not like Great Bridge
>> wants to turn PostgreSQL
>> into a pinball machine emulator.
> All right, who leaked the Great Bridge
> product plans. :-)
Somebody was bound to. We all agree that what
the world really needs is a Great Pinball
Machine Emulator--it's just that we want
there to
> My interpretation would be that if the
> consumer of the data wants to display
> it as a hyperlink, fine, but that that
> is the job of the application not the
> database
But MS Access is _both_, remember? The question
came up when migrating from Access talking to
its own local Jet database
> Question: Why isn't 12 printed after the second SELECT statement?
It's the well-known (?) problem that if any function parameter is NULL, they are all
set to NULL. IIRC someone is working on fixing this...
Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at
h
Perhaps I was too brief before, wanting to spare folks long quotes from the manual
that we all have, but here goes (quoting from
http://www.postgresql.org/users-lounge/docs/7.0/postgres/sql-createsequence.htm):
"After a sequence is created, you may use the function nextval(seqname) to get a ne
Edward Q. Bridges's detailed statement regarding sequences, of which I extract merely
the most pessimistic part:
> begin;
> insert into foo (A,B) values (B);
> select currval('foo_A_seq');
> commit;
>
> note that the transaction is key, without
> which there's no guarantee that some other
>
> Whenever I do inserts like yours, I do it in
> this kind of manner (I tried
> to use your pseudocode style):
> SELECT ID FROM ITEM WHERE URL='X' FOR UPDATE
> IF (ROW RETURNED) {
> $ID = ITEM.ID
> } ELSE {
> INSERT INTO ITEM ...
> GET THE OID [via PQoidStatus or your
> environment's equiva
Help! Is there any recent, comprehensive information for getting the openlink ODBC
drivers installed (i.e. something like a HOWTO) for Linux? The PostgreSQL site merely
links to openlink, but the information there is uselessly vague and/or out of date.
That is, installing the RPM plus the SD
> I thought that wouldn't work because PHP > doesn't substitute variables
> between single quotes :-(
You're right, it doesn't. But you don't _have_
single quotes in this case; the single quotes
are simply chars _inside_ the double_quoted
PHP string:
database = pg_Connect ("host=db.example.c
This looks scary to me:
> CREATE FUNCTION names_trig() RETURNS OPAQUE AS '
> DECLARE
> rec names%ROWTYPE;
> BEGIN
> IF TG_OP = ''INSERT'' THEN
> SELECT * INTO rec FROM names WHERE name = NEW.name;
> IF FOUND THEN
> UPDATE n
>I have setup a RH 6.2 box with postgres.
>The httpd (apache) has support for php3.
>But I don't know if the rh installation builds
>in the php3 support in postgres.
Here is the configuration setup from my own build of PHP3 (as an apache module,
supporting PostgreSQL):
Configure command: ./co
> What happens if someone else updates the
> record *just* after the record is
> reread for update and timestamp compared?
SELECT FOR UPDATE means no one else can update the row, doesn't it?
Join 18 million Eudora users by signing up for a free Eudora Web-Mail account at
http://www.eudorama
15 matches
Mail list logo