Re: Generating TRUNCATE orders

From: Richard Huxton <dev(at)archonet(dot)com>
To: Laurent ROCHE <laurent_roche(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Generating TRUNCATE orders
Date: 2007-10-03 17:11:15
Message-ID: 4703CD33.2010907@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2007-10-03 17:19:35 Re: Generating TRUNCATE orders
Previous Message Laurent ROCHE 2007-10-03 16:59:04 Generating TRUNCATE orders