Re: [SQL] Recording how a table is used

2009-07-08 Thread nha
Hello, Le 30/06/09 8:47, Daniel Gordon a écrit : > I'm trying to record the results of a select statement into a separate > table. I need the information selected, the column it was stored in, > the table it was stored in, and the query that selected it. > [...] > Here is the table I'm trying to

Re: [SQL] Recording how a table is used

2009-07-08 Thread nha
Hello, Le 8/07/09 11:30, nha a écrit : > Hello, > > Le 30/06/09 8:47, Daniel Gordon a écrit : >> I'm trying to record the results of a select statement into a separate >> table. I need the information selected, the column it was stored in, >> the table it was stored in, and the query that select

[SQL] Moving text columns, when it actually is large

2009-07-08 Thread Rob Sargent
I have to restructure some tables, coalescing common elements from three tables (sub-classes) into a single table (super-class). Each source table has a text field which actually gets stuffed with a largish (1Mb+) blob of xml. Is there any way to simply, um, er, transplant the pointer rather

[SQL] ERROR: function expression in FROM may not refer to other relations of same query level

2009-07-08 Thread Joseph S
I've seen this asked in the archives, but there was never any answer. Supposed I have this table: create temp table tempa (ids int[]); insert into tempa SELECT ARRAY[1 , 2, 3]; Now how do I get output from that? None of these work: (xunnest is my version of unnest since I'm using 8.2.x) se

Re: [SQL] ERROR: function expression in FROM may not refer to other relations of same query level

2009-07-08 Thread Tom Lane
Joseph S writes: > Supposed I have this table: > create temp table tempa (ids int[]); > insert into tempa SELECT ARRAY[1 , 2, 3]; > Now how do I get output from that? Uh, you didn't actually say what output you're looking for, but I'm going to guess it's this: regression=# select unnest(ids) f