Uros wrote:
I want to list all entries with duplicate urls.
I tried this:
select id,url,title from directory where url IN
(select url from directory group by url having count(url) 1)
ORDER by url;
Try:
select id,url,title from directory where
Alvaro Herrera wrote:
No, only the "second" one will fail (though it's difficult which one is
the second)
From:
http://marc.theaimsgroup.com/?l=postgresql-generalm=105656988915991w=2
Ian Barwick wrote:
[...]
I proposed that same solution 3 years ago.
Maksim Likharev wrote:
Finding if the duplicate value exists and inserting if not.
Ok, thanks but I think it is still vulnerable to a race condition.
I do not know how that will work for PG, but in Microsoft SQL Server
you can do following
BEGIN TRANSACTION
Alvaro Herrera wrote:
The thread is here:
http://groups.google.com/groups?hl=enlr=ie=UTF-8oe=UTF-8threadm=3A4D6116.1A613402%40mascari.comrnum=1prev=/groups%3Fq%3DMike%2BMascari%2BINSERT%2BNOT%2BEXISTS%26ie%3D
Thanks!
The solution is not correct in that there _is_ a race
Reuben D. Budiardja wrote:
No, onlu *one* of them will fail, but yes, the other will then generate error.
So it really is a trade off. Another way would be to lock the table, as other
has suggested. But then there is disadvantages to that also.
Really? I just got a post
Alvaro Herrera wrote:
Well, he is right. One will fail, the other will not. The race
condition is for the application. If you want to ignore it, you can do
that, but there _will_ be an ERROR thrown and the transaction will be
aborted.
Ah ... then maybe this solution
Reuben D. Budiardja wrote:
INSERT INTO mytable
SELECT 'value1', 'value2'
WHERE NOT EXISTS
(SELECT NULL FROM mytable
WHERE mycondition)
Thank you to everyone who helped out on my question. I am trying to
implement the above
a spare machine I
will give it a go though.
Thanks,
Jean-Christian Imbeault
---(end of broadcast)---
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
a;
sum
-
1
(1 row)
Thanks,
Jean-Christian Imbeault
---(end of broadcast)---
TIP 8: explain analyze is your friend
b b wrote:
What port does the postgresql server listen on.
It listens on whichever port you tell it to :) 5432 by default I think.
How do we know the port postgresql is listening on?
Make sure that tcp connections are enabled in the conf file. TCP
connection are
Key constraints: $1 FOREIGN KEY (pid) REFERENCES products(id) ON
UPDATE NO ACTION ON DELETE NO ACTION
How can I change the ON DELETE action to CASCADE for column pid?
I've check the alter table documentation but cannot find any reference
to this.
Thanks,
Jean-Christian Imbeault
with ON
DELETE CASCADE?
Thanks,
Jean-Christian Imbeault
---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send unregister YourEmailAddressHere to [EMAIL PROTECTED])
Table public.b
Column | Type | Modifiers
+--+---
id2| text |
Foreign Key constraints: $1 FOREIGN KEY (id2) REFERENCES a(id) ON UPDATE
NO ACTION ON DELETE NO ACTION
Jean-Christian Imbeault
---(end of broadcast)---
TIP 7
/3.2.2/../../../libreadline.so:
undefined reference to `UP'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libreadline.so:
undefined reference to `tgetstr'
collect2: ld returned 1 exit status
Thanks,
Jean-Christian Imbeault
---(end of broadcast
Does anyone know of any recent comparisons of postgres vs, Sybase ASE
12.5? I've looked around but can't find anything useful.
Thanks,
--
Jean-Christian Imbeault
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send
http://jdbc.postgresql.org/ seems to be down.
Also I can't connect to the mailing list subscription page at:
http://webmail.postgresql.org/mj/mj_wwwusr?domain=postgresql.orgfunc=lists-long-fullextra=pgsql-jdbc
Can anyone point me to another site where I can download the postgres
jdbc drivers?
16 matches
Mail list logo