Re: [SQL] filtering after join

2006-01-27 Thread andrew
I can see the final plan by using the EXPLAIN command. But I want to know the procedure of the planner in handling nesting queries. Can you direct me to the corresponding part of the code and/or the documents? Thanks. On 1/26/06, Peter Eisentraut [EMAIL PROTECTED] wrote: andrew wrote: How will

Re: [SQL] filtering after join

2006-01-27 Thread andrew
I got errors in this query. I have a function complete(record) which takes a generic record type data. But it seems cannot be applied to a sub-select result: backend explain select * from (select * from Person,Auction where Person.id=Auction.seller) as s where complete(s) QUERY: explain select *

Re: [SQL] Changing the transaction isolation level within

2006-01-27 Thread Mario Splivalo
On Thu, 2006-01-26 at 10:42 +0100, Markus Schaber wrote: Is it possible to change the transaction level within the procedure? No, currently not, the PostgreSQL stored procedures really are stored functions that are called inside a query, and thus cannot contain inner transactions. Is above

[SQL] REPOST:Memory Allocation error using pg_dump on 7.4

2006-01-27 Thread frank church
I repeatedly get this error whenever I try to backup a database The command used is: pg_dump -Fc -O -U username tablename tablename.20060122 pg_dump: ERROR: invalid memory alloc request size 4294967290 pg_dump: SQL command to dump the contents of table cc_ratecard failed: PQendcopy() failed.

[SQL] How to find a temporary table

2006-01-27 Thread Emil Rachovsky
Hi, I am using PostgreSQL 8.1.0 . How can I find a temp table from my session, having the name of the table? Can anyone show me what query should I execute? I've tried some things but I receive mixed results of tables from different sessions, which is strange.

Re: [SQL] How to find a temporary table

2006-01-27 Thread Mario Splivalo
On Fri, 2006-01-27 at 04:48 -0800, Emil Rachovsky wrote: Hi, I am using PostgreSQL 8.1.0 . How can I find a temp table from my session, having the name of the table? Can anyone show me what query should I execute? I've tried some things but I receive mixed results of tables from different

Re: [SQL] filtering after join

2006-01-27 Thread Tom Lane
andrew [EMAIL PROTECTED] writes: I got errors in this query. I have a function complete(record) which takes a generic record type data. But it seems cannot be applied to a sub-select result: As I seem to recall having mentioned several times already, PG 7.3 is really, really weak in this area.

Re: [SQL] filtering after join

2006-01-27 Thread andrew
I have traced the code. It exits when the argument is the result of a join or a subselect in function ParseFuncOrColumn(). The reason mentioned in the comments is lack of named tuple type. How can force it to create such a tuple type? is there a way? thanks a million times! On 1/27/06, Tom Lane

[SQL] Question about check constraints

2006-01-27 Thread Kashmira Patel \(kupatel\)
Hi all, I havea table where two columns have two different check constraints associated with them. When I update one column, the check constraint on the other column is also executed. Is there a way to avoid this? I want to check only for the condition defined for the column being

Re: [SQL] Question about check constraints

2006-01-27 Thread Michael Fuhr
On Fri, Jan 27, 2006 at 03:06:26PM -0800, Kashmira Patel (kupatel) wrote: I have a table where two columns have two different check constraints associated with them. When I update one column, the check constraint on the other column is also executed. Is there a way to avoid this? I want to

Re: [SQL] Question about check constraints

2006-01-27 Thread Kashmira Patel \(kupatel\)
Both concerns. 1) There are actually more than two columns with such checks, and each one calls a few functions which execute some more queries. So I would like to invoke these checks only when necessary. 2) The bigger concern is the side effect: Here's my schema: CREATE TABLE vm_device (

Re: [SQL] Question about check constraints

2006-01-27 Thread Stephan Szabo
On Fri, 27 Jan 2006, Kashmira Patel (kupatel) wrote: Both concerns. 1) There are actually more than two columns with such checks, and each one calls a few functions which execute some more queries. So I would like to invoke these checks only when necessary. 2) The bigger concern is the side

Re: [SQL] Question about check constraints

2006-01-27 Thread Kashmira Patel \(kupatel\)
Thanks, Michael and Stephan, for the replies. I think I will change my schema and remove the check constraint on the enable column, since, as Stephan pointed out, it was bad/wrong design to begin with. Thanks again. Kashmira -Original Message- From: Stephan Szabo [mailto:[EMAIL