[SQL] Fwd: [pgsql-es-ayuda] Ejecutar \copy desde VB

2007-06-19 Thread Jaime Casanova
-- Forwarded message -- From: Carlos Alberto Silva <[EMAIL PROTECTED]> Date: Jun 19, 2007 2:00 PM Subject: Re: [pgsql-es-ayuda] Ejecutar \copy desde VB To: Jaime Casanova <[EMAIL PROTECTED]> Yo lo harĂ­a de otra manera. Una rutina q lea el archivo de texto en VB (nada complicado d

Re: [SQL] join problem

2007-06-19 Thread Michael Glaesemann
[Please don't top post as it makes the discussion more difficult to follow, and please reply to the list so that others may benefit from and participate in the discussion.] On Jun 19, 2007, at 14:17 , A. R. Van Hook wrote: Michael Glaesemann wrote: On Jun 13, 2007, at 8:19 , A. R. Van Ho

Re: [SQL] separating improperly grouped page views

2007-06-19 Thread Jeff Frost
On Sun, 17 Jun 2007, Jeff Frost wrote: - Seq Scan on page_view pv1 (cost=0.00..11529031.34 rows=3580205 width=239) SubPlan -> Result (cost=1.58..1.59 rows=

Re: [SQL] joining a table whose name is stored in the primary record

2007-06-19 Thread Andrew Sullivan
On Tue, Jun 19, 2007 at 02:02:46PM -0400, John Gunther wrote: > Well, Andrew, you're certainly right but I made an exception because of > the data needs. Ah, well, in that case, you'll need something other than SQL for sure. A function as suggested is probably your friend. A -- Andrew Sullivan

Re: [SQL] joining a table whose name is stored in the primary record

2007-06-19 Thread John Gunther
Andreas Kretschmer wrote: create or replace function zip_foo(OUT out_id int, OUT out_name text, OUT out_name2 text) returns setof record as $$ declare my_rec RECORD; my_name TEXT; begin for my_rec in select id, name, parent_tbl, parent_id from zip LOOP e

Re: [SQL] joining a table whose name is stored in the primary record

2007-06-19 Thread John Gunther
Andrew Sullivan wrote: On Sun, Jun 17, 2007 at 04:39:51AM -0400, John Gunther wrote: functions and using subqueries without success. I think I need someone to point me in the right conceptual direction. Well, the right SQL-esque conceptual direction is not to have diffe

Re: [SQL] tsearch2() trigger and domain types...

2007-06-19 Thread manchicken
On Tuesday 19 June 2007 09:08:23 Tom Lane wrote: > oidtype = getBaseType(oidtype); I patched this in a FreeBSD 6.2 port. Attached is the patch. Thanks a lot for the help on this. It works like a charm. -- ~ manchicken <>< (A)bort, (R)etry, (I)nfluence with large hammer. 09 F9 11 02 9D 74 E3

Re: [SQL] [GENERAL] Subquery problems

2007-06-19 Thread Ranieri Mazili
Original Message Subject: Re:[GENERAL] Subquery problems From: Merlin Moncure <[EMAIL PROTECTED]> To: Ranieri Mazili <[EMAIL PROTECTED]> Date: 19/6/2007 10:40 On 6/19/07, Ranieri Mazili <[EMAIL PROTECTED]> wrote: Hello, I'm having another "problem", I have a function that

Re: [SQL] tsearch2() trigger and domain types...

2007-06-19 Thread Tom Lane
manchicken <[EMAIL PROTECTED]> writes: > Is there any way to cast these column datatypes in the trigger to fool it, No, you'd have to modify the trigger source code. It'd be a pretty trivial change to allow domains over textual types: continue; }

Re: [SQL] tsearch2() trigger and domain types...

2007-06-19 Thread manchicken
On Monday 18 June 2007 17:59:50 Tom Lane wrote: > "Michael D. Stemle, Jr." <[EMAIL PROTECTED]> writes: > > For standardization in my database I use a domain (login_t) for my login > > column in my profile table. > > > > Well, here's what I get upon every update and insert to the profile > > table:

[SQL] Subquery problems

2007-06-19 Thread Ranieri Mazili
Hello, I'm having another "problem", I have a function that declares 12 variable, one per month and each them execute a select like bellow: *DIV_MES01 := (select count(distinct production_date) from production where extract(month from production_date) = '01' and extract(year from production_da