Re: [SQL] Duplicate Fields + Views Questions

2006-11-03 Thread Dylan Lorimer
Thanks,Got it working with a UNION.Cheers,dylanOn 11/3/06, Richard Broersma Jr <[EMAIL PROTECTED] > wrote:> I've got 2 views - each with identical column names. I want to create an > aggregate view of both tables as a new view. But when I try to do this I> understandably get errors on duplicate fie

Re: [SQL] Duplicate Fields + Views Questions

2006-11-03 Thread Richard Broersma Jr
> I've got 2 views - each with identical column names. I want to create an > aggregate view of both tables as a new view. But when I try to do this I > understandably get errors on duplicate fields. > > As an example: > > CREATE VIEW gnis_view AS SELECT * FROM gnis_international_view, > gnis_usa_

[SQL] Duplicate Fields + Views Questions

2006-11-03 Thread Dylan Lorimer
Hi,I've got 2 views - each with identical column names. I want to create an aggregate view of both tables as a new view. But when I try to do this I understandably get errors on duplicate fields.As an example: CREATE VIEW gnis_view AS SELECT * FROM gnis_international_view, gnis_usa_view;ERROR:  col

[SQL] Long SQL Update Question

2006-11-03 Thread Dylan Lorimer
So I kicked off a SQL transaction that has been running for 30+ minutes. Is there any way to monitor it to know if it has possibly hanged or not? To be fair, it is an update on 4+ million rows, so I expect it to run for a bit. But any stats or metrics I can get would be helpful. Cheers, dylan

Re: [SQL] Index + View Question

2006-11-03 Thread imad
When you select from views, you are infact selecting from the underlying tables. Indexes created on those tables are used ultimately. --Imad www.EnterpriseDB.com On 11/4/06, Dylan Lorimer <[EMAIL PROTECTED]> wrote: Hi, If I've got several tables, each with their own indexes. I also have a vie

Re: [SQL] Index + View Question

2006-11-03 Thread Andrew Sullivan
On Fri, Nov 03, 2006 at 11:17:30AM -0800, Dylan Lorimer wrote: > If I've got several tables, each with their own indexes. I also have a view > that aggregates several of these tables. My question is, as novice-like as > it may sound, do I need to create new indexes on the view or do the indexes > f

[SQL] Index + View Question

2006-11-03 Thread Dylan Lorimer
Hi,If I've got several tables, each with their own indexes. I also have a view that aggregates several of these tables. My question is, as novice-like as it may sound, do I need to create new indexes on the view or do the indexes from the orig. tables apply somehow when I select data from the view?

Re: [SQL] delete and select with IN clause issues

2006-11-03 Thread Jeff Frost
On Fri, 3 Nov 2006, Tom Lane wrote: Jeff Frost <[EMAIL PROTECTED]> writes: Well, I spoke to soon on the it all works front. So, it's been reindexed and appears to be working properly now. I guess I'll keep an eye on it for a while. I didn't get your query suggestion in time, so hopefully I g

Re: [SQL] The empty list?

2006-11-03 Thread Aaron Bono
On 11/3/06, Jesper Krogh <[EMAIL PROTECTED]> wrote: ... but missing SQL for the empty list basically means thatwe cant handle the empty set encoded in the empty array withoutexplicitly introducing code for this size of array. From aprogramatically viewpoint, this seems quite odd. Somebody, somewher

Re: [SQL] Determining correct table order for insert or drop statements to satisfy foreign keys

2006-11-03 Thread Aaron Bono
On 11/2/06, Peter Hanson <[EMAIL PROTECTED]> wrote: Hi Aaron,I'm using PHP5 as the programming language.Unfortunately it looks like PHP has very limited support for meta data: http://us2.php.net/manual/en/function.pg-meta-data.php Check this out:http://www.postgresql.org/docs/8.0/interactive/functi

Re: [SQL] delete and select with IN clause issues

2006-11-03 Thread Tom Lane
Jeff Frost <[EMAIL PROTECTED]> writes: > Well, I spoke to soon on the it all works front. So, it's been > reindexed and appears to be working properly now. I guess I'll keep > an eye on it for a while. I didn't get your query suggestion in time, > so hopefully I grabbed the right binary file..th