Re: [SQL] 'fake' join and performance ?

2002-10-22 Thread Peter Galbavy
> That would be in violation of the SQL spec. The query is defined to > return each join row from the cross product of the FROM tables that > meets the condition of the WHERE clause. As you wrote the query, each > metadata row that meets the WHERE clause will be returned exactly as > many times a

Re: [SQL] 'fake' join and performance ?

2002-10-22 Thread Tom Lane
"Peter Galbavy" <[EMAIL PROTECTED]> writes: > photos=# select * from metadata m, images i WHERE m.name = 'Make' and > m.value = 'Canon' limit 10; > Er, what's that nested loop. I *know* I have shot myself in the foot > somehow, Yeah, you didn't restrict the reference to images at all. > but my i

Re: [SQL] 'fake' join and performance ?

2002-10-22 Thread Stephan Szabo
On Tue, 22 Oct 2002, Peter Galbavy wrote: > OK, I am now confused; postgresql 7.3beta2 on OpenBSD: > > > photos=# select * from metadata WHERE name = 'Make' and value = 'Canon' > limit 10; > > *bang*, 10 values, sub second response. > > photos=# select * from metadata m, images i WHERE m.name = '

Re: [SQL] Can I search for an array in csf?

2002-10-22 Thread Vernon Wu
Hi, Christoph, Thanks for reminding me regular expression. The background of my question is about attributes of one element, say hobby for example. Different people have different hobbies. Inside of the application, hobbies are denoted in various characters. The selection I mentioned in the

Re: [SQL] Can I search for an array in csf?

2002-10-22 Thread Josh Berkus
Vernon, > Thanks Josh, I will take a look at this book. > > The only problem with the implemention I can see so far is > performance: change format when read/write data. Other > than that, I don't see a big problem. I, however, shall say the > performance is important in my project. I'd think

[SQL] 'fake' join and performance ?

2002-10-22 Thread Peter Galbavy
OK, I am now confused; postgresql 7.3beta2 on OpenBSD: photos=# select * from metadata WHERE name = 'Make' and value = 'Canon' limit 10; *bang*, 10 values, sub second response. photos=# select * from metadata m, images i WHERE m.name = 'Make' and m.value = 'Canon' limit 10; *yawn* - see you la

Re: [SQL] using deferred on PK/FK relationships

2002-10-22 Thread Stephan Szabo
On Tue, 22 Oct 2002, Dan Langille wrote: > Can deferrable etc be used when deleting primary key records (master > table), then reinserting them without losing foreign key records > (slave table)? I ask because in our testing we can't; we lose the > foreign key records in the slave table. I'm guess

Re: [SQL] 7.2 date/time format function problems

2002-10-22 Thread Stephan Szabo
On Tue, 22 Oct 2002, Nicholas Barthelemy wrote: > I have just installed redhat 8.0. It comes with postgresql rpms for > 7.2.2. I have been trying to get an > application I have written to work, but my queries fail whenever I have > queries that use internal > date/time formatting functions. > exa

[SQL] using deferred on PK/FK relationships

2002-10-22 Thread Dan Langille
Can deferrable etc be used when deleting primary key records (master table), then reinserting them without losing foreign key records (slave table)? I ask because in our testing we can't; we lose the foreign key records in the slave table. I'm guessing we are trying to abuse the feature. here'

[SQL] 7.2 date/time format function problems

2002-10-22 Thread Nicholas Barthelemy
I have just installed redhat 8.0. It comes with postgresql rpms for 7.2.2. I have been trying to get an application I have written to work, but my queries fail whenever I have queries that use internal date/time formatting functions. example: SELECT a.assignmentid AS "id", u.lastname || ', ' ||

Re: Fwd: Re: [SQL] Can I search for an array in csf?

2002-10-22 Thread Vernon Wu
Hi, Achilleus and Josh, I know three ways to store dynamic array in DB: object, xml or csv, and sub-table. It seems to me there are some problems of using the first method in Java. I don't know how the third method work out. That is the reason I use the second method. In my project, the simp

Re: [SQL] Row Locking?

2002-10-22 Thread Richard Huxton
On Monday 21 Oct 2002 11:09 pm, eric soroos wrote: > I have a long running process that performs outside actions on the content > of a table. The actions could all be done in parallel (if I had n > processors), but I need to ensure that the process is attempted exactly one > time per applicable row

Re: [SQL] Locking that will delayed a SELECT

2002-10-22 Thread Ludwig Lim
--- Tom Lane <[EMAIL PROTECTED]> wrote: > A simple answer is to have T1 grab an ACCESS > EXCLUSIVE lock on some > table to block T2's progress. If that locks out > third-party > transactions that you'd rather would go through, you > can probably use > a lesser form of lock --- but then both T1 an

[SQL] 'next' or similar in plpgsql

2002-10-22 Thread Bhuvan A
Hi, In perl we have 'next' function to skip rest of the statements in the loop and to start with next iteration. In plpgsql, do we have something similar? How do we skip rest of the statements in a loop in plpgsql? TIA. regards, bhuvaneswaran ---(end of broadcast)-

Re: Fwd: Re: [SQL] Can I search for an array in csf?

2002-10-22 Thread Achilleus Mantzios
On Mon, 21 Oct 2002, Josh Berkus wrote: > > Vernon, > > > >> One field of a table stores an array of characters in a string fromat as > > >> "a,b,c,d". Is anyway to apply a select statement without using stored > > >> procedure? > > > The reason I use this format for an array is that the array is

Re: Fwd: Re: [SQL] Can I search for an array in csf?

2002-10-22 Thread Achilleus Mantzios
On Mon, 21 Oct 2002, Vernon Wu wrote: > > > > > Hi, Richard, > > Thanks for your response and see below. > > 10/21/2002 3:13:57 AM, Richard Huxton <[EMAIL PROTECTED]> wrote: > > >On Friday 18 Oct 2002 1:58 pm, Vernon Wu wrote: > >> One field of a table stores an array of characters in a string fro