Re: [SQL] Efficient DELETE Strategies

2002-08-26 Thread Bruce Momjian
Added to TODO: * Allow DELETE to handle table aliases for self-joins [delete] --- Manfred Koizar wrote: > On Mon, 10 Jun 2002 09:56:27 -0400, Tom Lane <[EMAIL PROTECTED]> > wrote: > >Does anyone know whether other

Re: [SQL] "reverse()" on strings

2002-08-26 Thread Josh Berkus
Jeff, h012, > CREATE FUNCTION fn_strrev(text) returns text as ' > return reverse($_[0]) > ' language 'plperl' with (iscachable); If you make that "WITH (ISCACHABLE, ISSTRICT)" the index will be faster to update on columns which contain large numbers of NULLs. "ISSTRICT" refers to the fact tha

Re: [SQL] "reverse()" on strings

2002-08-26 Thread Jeff Boes
On Mon, 26 Aug 2002 16:13:44 -0400, h012 wrote: > CREATE INDEX extension_idx ON file (reverse(name)); > -- but I didn't find a function called "reverse" > > CREATE INDEX extension_idx ON file (regex_match( '.*(\.[^\.]*)$' ); > -- but I didn't find a function called "regex_match" which would r

[SQL] "reverse()" on strings

2002-08-26 Thread h012
Hi, CREATE TABLE file (name varchar(255)); I have a couple of milion filenames. I need to build index based on extensions. A couple of possibilities come to mind: CREATE INDEX extension_idx ON file (reverse(name)); -- but I didn't find a function called "reverse" CREATE INDEX extension_

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-26 Thread Bruce Momjian
Magnus Enbom wrote: > On Mon, Aug 26, 2002 at 02:42:26PM -0400, Jan Wieck wrote: > > Bruce Momjian wrote: > > > > > > I found this email from April. It properly points out that our > > > LIMIT/FOR UPDATE ordering doesn't match MySQL's, and MySQL's looks more > > > correct, specifically that the

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-26 Thread Magnus Enbom
On Mon, Aug 26, 2002 at 02:42:26PM -0400, Jan Wieck wrote: > Bruce Momjian wrote: > > > > I found this email from April. It properly points out that our > > LIMIT/FOR UPDATE ordering doesn't match MySQL's, and MySQL's looks more > > correct, specifically that the FOR UPDATE is after the LIMIT.

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-26 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > I think FOR UPDATE looks more correct at the end because it > controls the visibility of the returned result, while LIMIT and the > other previous clauses control the result. FOR UPDATE clearly has a > different effect than LIMIT, GROUP BY, WHERE, and t

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-26 Thread Bruce Momjian
Jan Wieck wrote: > Bruce Momjian wrote: > > > > I found this email from April. It properly points out that our > > LIMIT/FOR UPDATE ordering doesn't match MySQL's, and MySQL's looks more > > correct, specifically that the FOR UPDATE is after the LIMIT. Our > > grammar is: > > How do you define

Re: [SQL] LIMIT 1 FOR UPDATE or FOR UPDATE LIMIT 1?

2002-08-26 Thread Jan Wieck
Bruce Momjian wrote: > > I found this email from April. It properly points out that our > LIMIT/FOR UPDATE ordering doesn't match MySQL's, and MySQL's looks more > correct, specifically that the FOR UPDATE is after the LIMIT. Our > grammar is: How do you define "correct" for "non-standard" fea

Re: [SQL] weird situation, BUG or I'm not doing it right

2002-08-26 Thread Jiaqing Wang
Ross, You're exactly right, I re-created my table with text(may not seem elegant), the problem is solved. Thanks to all of your advice, I can now go on with my life with PostgreSQL. :) jjw 8/25/2002 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Ross J.

Re: [SQL] Separating data sets in a table

2002-08-26 Thread Oliver Elphick
On Mon, 2002-08-26 at 10:46, Andreas Tille wrote: > On 26 Aug 2002, Oliver Elphick wrote: > > > Select from the temporary table all items that satisfy the > > constraints, insert them into the real table and delete them from > > the temporary table: > > > > BEGIN; > >

Re: [SQL] Separating data sets in a table

2002-08-26 Thread Andreas Tille
On 26 Aug 2002, Oliver Elphick wrote: > Create a temporary table (no constraints) > > CREATE TEMP TABLE temptable AS > (SELECT * FROM tablename LIMIT 1); > DELETE FROM temptable; > > Copy all data into the temporary table > > COPY temptable FROM 'filepath

[SQL] unsubscribe

2002-08-26 Thread Gaetano Mendola
unsubscribe ---(end of broadcast)--- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly

Re: [SQL] Separating data sets in a table

2002-08-26 Thread Oliver Elphick
On Mon, 2002-08-26 at 07:26, Andreas Tille wrote: > Well for sure this might be an option but as I said I receive the data > in the dump format apropriate to use "COPY FROM ". Would > you really like to suggest me to split those data sets into single lines? > Moreover I'm not sure about how to c