[SQL] List table with same column name

2003-10-23 Thread Abdul Wahab Dahalan
Hi! How do I list all the tables in the database which has a same column name?. Thanks ---(end of broadcast)--- TIP 4: Don't 'kill -9' the postmaster

Re: [SQL] List table with same column name

2003-10-23 Thread achill
On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: Hi! How do I list all the tables in the database which has a same column name?. SELECT t1.relname,a1.attname,t2.relname from pg_class t1,pg_attribute a1,pg_class t2,pg_attribute a2 where a1.attrelid=t1.oid and t1.relkind='r' and a1.attnum0 and

Re: [SQL] List table with same column name

2003-10-23 Thread Peter Childs
On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: Hi! How do I list all the tables in the database which has a same column name?. SELECT t1.relname,a1.attname,t2.relname from pg_class t1,pg_attribute a1,pg_class t2,pg_attribute a2 where

Re: [SQL] List table with same column name

2003-10-23 Thread achill
On Thu, 23 Oct 2003, Peter Childs wrote: On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: Hi! How do I list all the tables in the database which has a same column name?. SELECT t1.relname,a1.attname,t2.relname from pg_class

Re: [SQL] List table with same column name

2003-10-23 Thread Peter Childs
On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Peter Childs wrote: On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: Hi! How do I list all the tables in the database which has a same column name?. SELECT

Re: [SQL] List table with same column name

2003-10-23 Thread Achilleus Mantzios
On Thu, 23 Oct 2003, Peter Childs wrote: On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Peter Childs wrote: On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: On Thu, 23 Oct 2003, Abdul Wahab Dahalan wrote: Hi! How do I list all the tables in

[SQL] Fw: Error message during compressed backup

2003-10-23 Thread Kumar
Dear Friends, While doing compressed backup for one of the database running at Postgres Server 7.3.4 on RH Linux 7.2, I got the following error., but it backup other items --Command to backup $ $ pg_dump -h 192.xxx.x.xxx -p 5432 -vtestdb -f /home/db_repository/testdb20031023.sql.tar.gz -u

Re: [SQL] Fw: Error message during compressed backup

2003-10-23 Thread Richard Huxton
On Thursday 23 October 2003 10:57, Kumar wrote: Dear Friends, While doing compressed backup for one of the database running at Postgres Server 7.3.4 on RH Linux 7.2, I got the following error., but it backup other items --Command to backup $ $ pg_dump -h 192.xxx.x.xxx -p 5432 -v testdb -f

[SQL] Left outer join and sub queries alias

2003-10-23 Thread ext-thierry . templier
Hello, I try to make work this request: select * from ( select * from personne_nom where personne_nom_pal=1 ) as tmp, personne left outer join tmp on ( personne.personne_id = tmp.personne_nom_personne_id ) where personne_id=57 The error on execution is: ERROR: Relation tmp does

Re: [SQL] Left outer join and sub queries alias

2003-10-23 Thread Richard Huxton
On Thursday 23 October 2003 12:37, [EMAIL PROTECTED] wrote: Hello, I try to make work this request: Try: select * from ( select * from personne_nom where personne_nom_pal=1 ) as tmp, left outer join personne on ( personne.personne_id = tmp.personne_nom_personne_id ) where

Re: [SQL] Query planner: current_* vs. explicit date

2003-10-23 Thread Chris Gamache
Thanks Tom (and others!) Right-on-the-money, as always... By giving it a definitive range I was able to coax query planner to use the index: SELECT id FROM trans_table WHERE trans_date = (SELECT current_date::timestamptz) AND trans_date (SELECT current_timestamp); gave me from midnight to the

Re: [SQL] Réf. : Re: [SQL] Left outer join

2003-10-23 Thread Richard Huxton
On Thursday 23 October 2003 14:39, [EMAIL PROTECTED] wrote: Hello, It doesn't work... You don't say how. By the way, please try to reply to the list as well as directly to the person. Have you examples on left outer join on a table that is a part of a table? THanks, richardh=# select *

[SQL] Query Help

2003-10-23 Thread yusuf0478
I'm interested in finding the minimim A.id such that the following holds: select A.charge , B.user_id , C.employee_id from A inner join B using (user_id) inner join C using (employee_id) except select X.charge , Y.user_id , Z.employee_id from X inner join Y using (user_id) inner

Re: [SQL] Regular expression problem

2003-10-23 Thread Manuel Sugawara
Matias Surdi [EMAIL PROTECTED] writes: Hi... I'm dealing with a regular expression in a check constraint for many days i'm stuck with this... what I'm doing is adding a check to an existing table on a field called codigoex1 (varchar(9) ) check (codigoex1 ~* '[a-z]{2,2}') and I

Re: [SQL] Query Help

2003-10-23 Thread scott.marlowe
On Thu, 23 Oct 2003 [EMAIL PROTECTED] wrote: I'm interested in finding the minimim A.id such that the following holds: select A.charge , B.user_id , C.employee_id from A inner join B using (user_id) inner join C using (employee_id) except select X.charge , Y.user_id

[SQL] Error message during compressed backup

2003-10-23 Thread Senthil Kumar S
Dear Friends, While doing compressed backup for one of the database running at Postgres Server 7.3.4 on RH Linux 7.2, I got the following error., but it backup other items --Command to backup $ $ pg_dump -h 192.xxx.x.xxx -p 5432 -vtestdb -f /home/db_repository/testdb20031023.sql.tar.gz -u

[SQL] Query Help using Except

2003-10-23 Thread yusuf0478
I'm interested in finding the minimim A.id such that the following holds: select A.charge , B.user_id , C.employee_id from A inner join B using (user_id) inner join C using (employee_id) except select X.charge , Y.user_id , Z.employee_id from X inner join Y using (user_id) inner

[SQL] A tricky sql-query...

2003-10-23 Thread Timo
We have a small association and the association has a cabin. Members of the association can rent a term to stay in the cabin but as the cabin has turned out to be very famous we have had to establish an application policy for that. It goes like this: 1. There's a seniority queue for this

[SQL] help on update subselect with joins

2003-10-23 Thread Jeff Kowalczyk
I need to adapt this an update statement to a general form that will iterate over multiple orderids for a given customerinvoiceid. My first concern is a form that will work for a given orderid, then an expanded version that will work on all orderids with a specific customerinvoiceid as a

Re: [SQL] Query Help

2003-10-23 Thread yusuf0478
Wouldn't that return every A.id ? since A.id would be compared to -1, and the wouldnt' be the same. I want: select min(A.id) such that A.charge, B.userid, C.employee_id in ( select A.charge , B.user_id , C.employee_id from A inner join B using (user_id) inner join C using