Search Postgresql Archives

Re: Generating TRUNCATE orders

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Laurent ROCHE wrote:
So I wrote: SELECT 'TRUNCATE TABLE ' UNION
...
ORDER BY relname
And this fails with the following message:
ERROR: column "relname" does not exist

But I don't understand why this does not work: the 2 SELECTs produce a single char column so from what I understand that should work ! ? !
If some body can explain I will be grateful.

The "ORDER BY" is attached to the "UNION" not the second subquery. Catches everyone out from time to time.

--
  Richard Huxton
  Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

              http://www.postgresql.org/docs/faq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux