Re: [SQL] foreign key problem

2002-10-09 Thread Laurette Cisneros
7.2.3. It's a mystery as to how this happened but there is a program we use to copy rows from one version to another. For some reason the person who wrote it disabled triggers before copying rows to a new version then re-enabled the triggers. If someone made changes while the triggers were off

Re: [SQL] problem with the Index

2002-10-09 Thread Stephan Szabo
On Wed, 9 Oct 2002, Jose Antonio Leo wrote: > I have a problem with the index of 1 table. > > I hava a table created : > CREATE TABLE "acucliart" ( >"cod_pto" numeric(8,0) NOT NULL, >"cod_cli" varchar(9) NOT NULL, >"mes" numeric(2,0) NOT NULL, >"ano" numeric(4,0) NOT NULL, >

Re: [SQL] SELECT statement never completes.

2002-10-09 Thread Stephan Szabo
On Wed, 9 Oct 2002, John Pauley wrote: > pgsql-sql, > > We are porting a database from IBM DB2 to PostgreSQL. > In several related scripts, there is a SELECT > statement that never completes in Postgres but > completes in a few seconds using DB2, for example: > > Table row count: > SELECT count(*

[SQL] SELECT statement never completes.

2002-10-09 Thread John Pauley
pgsql-sql, We are porting a database from IBM DB2 to PostgreSQL. In several related scripts, there is a SELECT statement that never completes in Postgres but completes in a few seconds using DB2, for example: Table row count: SELECT count(*) FROM tableX; 112671 SELECT count(*) from tableY; 31

[SQL] problem with the Index

2002-10-09 Thread Jose Antonio Leo
I have a problem with the index of 1 table. I hava a table created : CREATE TABLE "acucliart" ( "cod_pto" numeric(8,0) NOT NULL, "cod_cli" varchar(9) NOT NULL, "mes" numeric(2,0) NOT NULL, "ano" numeric(4,0) NOT NULL, "int_art" numeric(5,0) NOT NULL, "cantidad" numeric(1

Re: [SQL] Complex SQL query and performance strategy

2002-10-09 Thread Tom Lane
Adam Witney <[EMAIL PROTECTED]> writes: > I have a complex SQL query which requires the joining of 18 tables. There > are only primary key indices on the table and at the moment it runs a little > slow (30s or so) and so I am trying to optimise it. > The output of EXPLAIN is a little confusing an

[SQL] Complex SQL query and performance strategy

2002-10-09 Thread Adam Witney
Hi, I have a complex SQL query which requires the joining of 18 tables. There are only primary key indices on the table and at the moment it runs a little slow (30s or so) and so I am trying to optimise it. The output of EXPLAIN is a little confusing and seems to vary from run to run. Does the

Re: [SQL] PLPGSQL errors

2002-10-09 Thread Richard Huxton
On Wednesday 09 Oct 2002 11:06 am, Rudi Starcevic wrote: > > error: > [postgres@central postgres]$ /usr/local/pgsql/bin/psql demo -f > sysinsert.sql psql:sysinsert.sql:16: NOTICE: Error occurred while > executing PL/pgSQL function fn_sysmessages_log > psql:sysinsert.sql:16: NOTICE: at END of top

[SQL] PLPGSQL errors

2002-10-09 Thread Rudi Starcevic
Hi, I'm getting an error on a function I want to execute and I can't see why. I've tried a few different things and tweaked my sql without joy so far. I want to log all inserts or updates on one table to another table. Below I have my error, function , table schema and sql insert statement. Th

Re: [SQL] Problems Formulating a SELECT

2002-10-09 Thread Richard Huxton
On Tuesday 08 Oct 2002 7:19 pm, Charles Hauser wrote: > Richard, > [snip] > Is there a method to remove duplicate results? For instance the query > below in part yields : SELECT DISTINCT ... is what you're after. I'd do it in the views so the join has less rows to compare against. > chlamy_est