[SQL] contrib/dblink suggestion

2002-07-29 Thread Bhuvan A
Hi, I am using postgresql 7.2.1. I badly require to interconnect between databases. contrib/dblink seems to be handy and ofcourse it well suits my requirement. But while browsing across, i heard that it is not advicable to use it. So i wish to know someone's experience in using dblink and how han

Re: [SQL] Extremely slow query

2002-07-29 Thread Christopher Kings-Lynne
Did you know that you can probably change your GROUP BY clause to use a column ref, rather than repeating the CASE statement: GROUP BY gmmid, gmmname, divid, divname, feddept, deptname, fedvend, vendor_name, masterid, master_desc, pageid, oz_description, 13, price_original, price_owned_retail,

[SQL] Extremely slow query

2002-07-29 Thread Patrick Hatcher
System: OS: RedHat 7.2 Dual PIII XEON Mem 512 mg PG: 7.2 I have what I think is a fairly simple summary query, but it takes 1:55 to run on just 155k records. The query hits against a single table that I use for reporting purposes. This table is truncated, refreshed, reindexed, and vacuum analy

Re: [SQL] Decision support query inefficiencies ...

2002-07-29 Thread Tom Lane
Gunther Schadow <[EMAIL PROTECTED]> writes: > A very frequent decision support query we have to make is to get the > last act of a certain type that occurred before a certain cut-off > date. This seems pretty close to the type of problem DISTINCT ON is intended to solve. Look at the "weather rep

Re: [SQL] Returning PK of first insert for second insert use.

2002-07-29 Thread Peter Atkins
Thank you for explaining that in detail it makes sense now. I'll give it a try. Thanks again! -p -Original Message- From: Ken Corey [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 1:05 PM To: Peter Atkins Cc: '[EMAIL PROTECTED]' Subject: RE: Returning PK of first insert for second

[SQL] Returning PK of first insert for second insert use.

2002-07-29 Thread Peter Atkins
All, I have two tables t_proj, t_task see below: CREATE TABLE t_proj ( proj_id SERIAL NOT NULL, PRIMARY KEY (proj_id), task_id integer(12), user_id integer(6), title varchar(35), description varchar(80) ); CREATE TABLE t_task ( task_id SERIAL NOT NULL, PRIMARY KEY (task_id), title varchar(35),

Re: RES: [SQL] RES: [GENERAL] set DateStyle to 'SQL'

2002-07-29 Thread Roberto Mello
On Mon, Jul 29, 2002 at 08:57:12AM -0300, Elielson Fontanezi wrote: > Bom dia Roberto! Bom Dia! :-) > I have just read these documents. > The variables listed in the link below, say about variable that I > cannot > set from a .profile file. > By the way, if I wat to state that

[SQL] Alter column

2002-07-29 Thread Thiemo Kellner
Hi, I wonder if I can alter the type of a column to a "supertype" of the original column type? Afaik, this was impossible in 7.1.3. However, I use 7.2.1. If yes, what would be the correct syntax? Cheers, Thiemo -- Thiemo Kellner Tösstalstrasse 146 CH-8400 Winterthur http://jermt.sourceforge

Re: [SQL] using LIMIT only on primary table

2002-07-29 Thread Lee Harr
In article <3D42D7AA.27447.3EE190A0@localhost>, "Dan Langille" wrote: > This is an extension of the problem solved by > http://archives.postgresql.org/pgsql-sql/2002-03/msg00020.php but > with a slightly different complication. > > I want to get the last 100 port commits from the database. Com

Re: [SQL] [GENERAL] 1 milion data insertion

2002-07-29 Thread Chris Albertson
> > Ok, this was a test. I'd like to know what would be happen. > But, from you, great PostGres DBA's, what is the best way to > insert a large number of data? > Is there a way to turn off the log? > Is there a way to commit each 100 records? Yes, "COPY" actually d

RES: [SQL] RES: [GENERAL] set DateStyle to 'SQL'

2002-07-29 Thread Elielson Fontanezi
Bom dia Roberto! I have just read these documents. The variables listed in the link below, say about variable that I cannot set from a .profile file. By the way, if I wat to state that all NUMERIC values must follow a format as ###,###.##& these docs do not say how to do t

[SQL] RES: [GENERAL] The best book

2002-07-29 Thread Elielson Fontanezi
E.F.:> E.F.:> Hi, E.F.:> E.F.:> Well depends what are you looking for. E.F.:> E.F.:> I am using a lot PostgreSQL: Introduction and Concepts E.F.:> by Bruce Momjian. E.F.:> Then I have bought "PHP and PostgreSQL Advanced Web E.F.:> Programming" by E.F.:> Ewald Geschwinde and Hans-Juergen Sc

[SQL] RES: [GENERAL] The best book

2002-07-29 Thread Elielson Fontanezi
Thanks to answer me. You was very kindly to write me a so nice text. :-) E.F.:> The "best book" for you really depends on what you are after! E.F.:> E.F.:> Are you interested in a book which is easy to read, gives good E.F.:> foundational concepts, and gives you decent skills with E.F.:> Postgr