On Wed, 2009-08-19 at 08:58 -0400, Arturo Pérez wrote:

> 19-Aug 02:24 bacula-dir JobId 1951: Fatal error: sql_create.c:789  
> Fill Path table Query failed: INSERT INTO Path (Path) SELECT a.Path  
> FROM (SELECT DISTINCT Path FROM batch) AS a WHERE NOT EXISTS (SELECT  
> Path FROM Path WHERE Path = a.Path) : ERR=ERROR:  array size exceeds  
> the maximum allowed (268435455)

That's odd. Where's the array? Subqueries shouldn't result in arrays in
any way, no?

On my Bacula install there are no triggers on the `path' table and it's
a very simple table:

                           Table "public.path"
 Column |  Type   |                       Modifiers                       
--------+---------+-------------------------------------------------------
 pathid | integer | not null default nextval('path_pathid_seq'::regclass)
 path   | text    | not null
Indexes:
    "path_pkey" PRIMARY KEY, btree (pathid)
    "path_name_idx" btree (path)


so I'm a bit puzzled. Just to see, try expressing the query in two steps:

SELECT path INTO TEMPORARY TABLE batch_path
FROM  batch GROUP BY path;

INSERT INTO Path (Path)
SELECT batch_path.Path
FROM batch_path AS a
WHERE NOT EXISTS (SELECT 1 FROM Path WHERE Path = a.Path);

-- 
Craig Ringer


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to