I'm assuming you want "n" to be replaced by the numbers up to
the last one where there is a table1_n and table2_n, right?
I'd suggest looking and PL/TCL (or if you can wait for 7.1, you
can probably do it in PL/PGSQL as well with the new exec stuff.)
and writing a function that does the inserts
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> testdb=#CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3 FROM
> table1_n;
> ERROR: DISTINCT not supported in views
In that case, you'll have to create a temporary table instead. This may
actually be faster, because you only have to search
Thanks, but:
testdb=#CREATE VIEW tableselecttemp AS SELECT DISTINCT f1, f2, f3 FROM
table1_n;
ERROR: DISTINCT not supported in views
Jerome.
Ian Turner wrote:
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> > I want to execute this query on some table2 in the same time :
> >
> > INS
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
> I want to execute this query on some table2 in the same time :
>
> INSERT INTO table2_n(f1, f2, f3)
> SELECT DISTINCT f1, f2, f3 FROM table1_n ;
One way would be to do:
BEGIN
CREATE VIEW tableselecttemp AS
SELECT DISTINCT f1, f2, f3
I want to execute this query on some table2 in the same time :
INSERT INTO table2_n(f1, f2, f3)
SELECT DISTINCT f1, f2, f3 FROM table1_n ;
--
CREATE TABLE table1_1( INT2 f1, INT2 f2, INT2 f3, INT2 f4 );
CREATE TABLE table1_