Re: [GENERAL] Selecting dupes from table

2003-06-24 Thread Jean-Christian Imbeault
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

Re: [GENERAL] Duplicate key insert question

2003-07-01 Thread Jean-Christian Imbeault
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.

Re: [GENERAL] Duplicate key insert question

2003-07-01 Thread Jean-Christian Imbeault
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

Re: [GENERAL] Duplicate key insert question

2003-07-01 Thread Jean-Christian Imbeault
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

Re: [GENERAL] Duplicate key insert question

2003-07-01 Thread Jean-Christian Imbeault
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

Re: [GENERAL] Duplicate key insert question

2003-07-01 Thread Jean-Christian Imbeault
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

Re: [GENERAL] Duplicate key insert question

2003-07-01 Thread Jean-Christian Imbeault
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

[GENERAL] Performance question

2003-07-01 Thread Jean-Christian Imbeault
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

[GENERAL] select null + 0 question

2003-07-13 Thread Jean-Christian Imbeault
a; sum - 1 (1 row) Thanks, Jean-Christian Imbeault ---(end of broadcast)--- TIP 8: explain analyze is your friend

Re: [GENERAL] Port?

2003-07-31 Thread Jean-Christian Imbeault
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

[GENERAL] adding on delete cascade constraint?

2003-09-19 Thread Jean-Christian Imbeault
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

Re: [GENERAL] adding on delete cascade constraint?

2003-09-19 Thread 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])

[GENERAL] Foreign key constraint accepted even when not same data type

2003-09-22 Thread Jean-Christian Imbeault
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

[GENERAL] install; readline error with 7.3.4

2003-10-08 Thread Jean-Christian Imbeault
/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

[GENERAL] Postgres vs Sybase ASE

2004-07-19 Thread Jean-Christian Imbeault
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

[GENERAL] Problems with JDBC site and Postgres mailing list subscription page

2004-12-10 Thread Jean-Christian Imbeault
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?