Re: [HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread Bruce Momjian
On Wed, Jul 20, 2016 at 06:03:08PM -0400, Tom Lane wrote: > Greg Stark writes: > > But I think I agree that it's surprising that the collate clause isn't > > working in the ORDER BY on a column produced by a UNION. Certainly > > that's where people usually want to put it. > > See this ancient com

Re: [HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread Bruce Momjian
On Wed, Jul 20, 2016 at 10:55:38PM +0100, Greg Stark wrote: > On Wed, Jul 20, 2016 at 10:38 PM, Bruce Momjian wrote: > > SELECT 'a-c' AS x UNION ALL SELECT 'ab' AS x ORDER BY x COLLATE "C"; > > > ::***> select 'a-c' COLLATE "C" AS x UNION ALL SELECT 'ab' AS x ORDER BY x ; Oh, collate on the str

Re: [HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread Tom Lane
Greg Stark writes: > But I think I agree that it's surprising that the collate clause isn't > working in the ORDER BY on a column produced by a UNION. Certainly > that's where people usually want to put it. See this ancient comment in transformSetOperationStmt: * For now, we don't support r

Re: [HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread Greg Stark
Actually there's nothing about UNION here. It's true for any column alias: ::***> select 'a-c' AS x ORDER BY x COLLATE "C" ; ERROR: 42703: column "x" does not exist LINE 2: select 'a-c' AS x ORDER BY x COLLATE "C" ; ^ LOCATION: errorMissingColumn, parse_relatio

Re: [HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread David G. Johnston
On Wed, Jul 20, 2016 at 5:38 PM, Bruce Momjian wrote: > I think the 'ORDER BY x COLLATE "C"' is being parsed as an a_expr, and > we don't allow a_expr in a UNION. Perhaps we are too strict here, but I > can't tell. > ​ORDER BY 1 COLLATE "C" is indeed an expression - the number no longer refers

Re: [HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread Greg Stark
On Wed, Jul 20, 2016 at 10:38 PM, Bruce Momjian wrote: > SELECT 'a-c' AS x UNION ALL SELECT 'ab' AS x ORDER BY x COLLATE "C"; ::***> select 'a-c' COLLATE "C" AS x UNION ALL SELECT 'ab' AS x ORDER BY x ; ┌─┐ │ x │ ├─┤ │ a-c │ │ ab │ └─┘ (2 rows) But I think I agree that it's surp

[HACKERS] Odd error when using UNION and COLLATE

2016-07-20 Thread Bruce Momjian
Seems you can't use UNION and COLLATE in the same SELECT statement; you have to put the UNION inside of WITH and then do the COLLATE outside: test=> SELECT 'a-c' AS x UNION ALL SELECT 'ab' AS x ORDER BY 1 COLLATE "C"; ERROR: collations are not supported by type integer LINE 1: ... 'a-c' AS x

Re: [HACKERS] Odd error during vacuum

2002-04-10 Thread Tom Lane
Gavin Sherry <[EMAIL PROTECTED]> writes: >> NOTICE: RegisterSharedInvalid: SI buffer overflow >> NOTICE: InvalidateSharedInvalid: cache state reset > To fix this increase shared_buffers. AFAIK shared_buffers has no direct effect on the rate of SI overruns. I suppose it might have an indirect e

Re: [HACKERS] Odd error during vacuum

2002-04-10 Thread Gavin Sherry
On Thu, 11 Apr 2002, Christopher Kings-Lynne wrote: > Hi all, > > I got these odd messages while doing a vacuum in 7.1.3 0 - any idea what > they mean? I assume it's not fatal as they're just notices, but I've never > had them before and haven't had them since. > > NOTICE: RegisterSharedInvali

[HACKERS] Odd error during vacuum

2002-04-10 Thread Christopher Kings-Lynne
Hi all, I got these odd messages while doing a vacuum in 7.1.3 0 - any idea what they mean? I assume it's not fatal as they're just notices, but I've never had them before and haven't had them since. NOTICE: RegisterSharedInvalid: SI buffer overflow NOTICE: InvalidateSharedInvalid: cache state

Re: [HACKERS] Odd error...

2001-07-17 Thread Tom Lane
"Dominic J. Eidson" <[EMAIL PROTECTED]> writes: > On Tue, 17 Jul 2001, Philip Warner wrote: > Any ideas what would cause this? >> >> Probably the length of the view name; which version are you running? I >> haven't look at PG for a while, but I thought this was fixed in 7.1.2 > PostgreSQL 7.1 o

Re: [HACKERS] Odd error...

2001-07-17 Thread Dominic J. Eidson
On Tue, 17 Jul 2001, Philip Warner wrote: > At 22:12 16/07/01 -0500, Dominic J. Eidson wrote: > >morannon:~>pg_dump -t bboard openacs | less > >getTables(): SELECT (for VIEW ec_subsubcategories_augmented) returned NULL > oid > >SELECT was: SELECT definition as viewdef, (select oid from pg_rewrite

Re: [HACKERS] Odd error...

2001-07-16 Thread Philip Warner
At 22:12 16/07/01 -0500, Dominic J. Eidson wrote: >morannon:~>pg_dump -t bboard openacs | less >getTables(): SELECT (for VIEW ec_subsubcategories_augmented) returned NULL oid >SELECT was: SELECT definition as viewdef, (select oid from pg_rewrite >where rulename='_RET' || viewname) as view_oid from

[HACKERS] Odd error...

2001-07-16 Thread Dominic J. Eidson
morannon:~>pg_dump -t bboard openacs | less getTables(): SELECT (for VIEW ec_subsubcategories_augmented) returned NULL oid SELECT was: SELECT definition as viewdef, (select oid from pg_rewrite where rulename='_RET' || viewname) as view_oid from pg_views where viewname = 'ec_subsubcategories_augme