Re: [SQL] Cascading deletions does not seem to work inside PL/PGSQL functions.

2002-07-18 Thread Rajesh Kumar Mallah.
Thanks for your reply. Stephan. On Thursday 18 July 2002 12:01, you wrote: On Thu, 18 Jul 2002, Rajesh Kumar Mallah. wrote: what if i do not want to fire sperate delete SQLs for the slave tables ? Hi , what is mean is that I a have many tables(x,y,z...) which reference the

Re: [SQL] [HACKERS] why is postgres estimating so badly?

2002-07-18 Thread Luis Alberto Amigo Navarro
AND part.name LIKE '%green%' It's difficult for the planner to produce a decent estimate for the selectivity of an unanchored LIKE clause, since there are no statistics it can use for the purpose. We recently changed FIXED_CHAR_SEL in src/backend/utils/adt/selfuncs.c from 0.04 to 0.20,

[SQL] how do i import my sql query result to a file

2002-07-18 Thread Joseph Syjuco
how do i import results of my select query to a file thanks ---(end of broadcast)--- TIP 6: Have you searched our list archives? http://archives.postgresql.org

Re: [SQL] Newbie: Creative use of LIMIT??

2002-07-18 Thread Richard Huxton
On Wednesday 17 Jul 2002 3:20 am, Shmuel A. Kahn wrote: Assuming I have the following two tables of people and their nicknames, and that I want to create a list containing UPTO 2 (or any value greater than 1) nicknames for EACH member of a specific family (Fam column), how would I do this?

Re: [SQL] How to find out if an index is unique?

2002-07-18 Thread Ligia Pimentel
You could also use describe (in psql environment ) psql mydatabase mydatabase=# \d indexname Index indexname Attribute | Type +--- fieldname| datatype unique btree The word unique will show up only if the index has the unique qualification, otherwise it will

Re: [SQL] [HACKERS] why is postgres estimating so badly?

2002-07-18 Thread Nathan C. Burnett
The first thing to point out is that the estimated cost is measured in terms of page reads while the actual time is measured in milliseconds. So even if the cost estimate is accurate it is unlikely that those numbers will be the same. -N -- Nathan C. Burnett Research Assistant, Wisconsin

Re: [SQL] how do i import my sql query result to a file

2002-07-18 Thread Robert Treat
not sure I understand the question, but from inside psql you can do: \o FILENAMEsend all query results to file or |pipe Robert Treat On Thu, 2002-07-18 at 17:47, Joseph Syjuco wrote: how do i import results of my select query to a file thanks ---(end of

Re: [SQL] Indexing UNIONs

2002-07-18 Thread Josh Berkus
Bruno, My suggestion: SELECT t3.id, coalesce(t1.name, t2.name), t1.abbreviation, coalesce(t1.juris_id, t2.juris_id) from (t3 left join t1 using (id)) left join t2 using (id); Cool! I didn't think of that. I'll give it a try. -Josh ---(end of

Re: [SQL] how do i import my sql query result to a file

2002-07-18 Thread Ludwig Lim
--- Joseph Syjuco [EMAIL PROTECTED] wrote: how do i import results of my select query to a file thanks in the psql command prompt type \o filename and then type your select query. The result will be dumped into filename ludwig. __ Do You

Re: [SQL] how do i import my sql query result to a file

2002-07-18 Thread Joseph Syjuco
thanks for the tips !!! actually i used \g filename. Again thanks On Thu, 2002-07-18 at 20:34, Ludwig Lim wrote: --- Joseph Syjuco [EMAIL PROTECTED] wrote: how do i import results of my select query to a file thanks in the psql command prompt type \o filename and then type your