C function fails afeter create extension but ok after reconnect

From: Stephen Woodbridge <imaptools(at)gmail(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: C function fails afeter create extension but ok after reconnect
Date: 2013-05-19 17:55:37
Message-ID: 51991219.8040508@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi all,

I have a C function that works fine in all cases except if I try to run
it after create extension without reconnecting to the database.

So this fails:

createdb -U postgres -h localhost ttt
psql -U postgres -h localhost ttt
create extension postgis;
create extension pgrouting;
-- create some data
select cost, count(*) from (
select * from pgr_drivingdistance('select id, source, target,
1.0::float8 as cost from ddnoded2', 1274, 10, false, false)
) as foo group by cost order by cost asc;

-- fails with a bad-alloc in boost

\c ttt

select cost, count(*) from (
select * from pgr_drivingdistance('select id, source, target,
1.0::float8 as cost from ddnoded2', 1274, 10, false, false)
) as foo group by cost order by cost asc;

-- run to successful conclusion

Also if a reconnect after the create extension command everything is ok.

Anyone know why this is and how I can fix it ot what to look for in my code?

Thanks,
-Steve

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Toby Corkindale 2013-05-20 01:07:59 Re: Deploying PostgreSQL on CentOS with SSD and Hardware RAID
Previous Message Chris Travers 2013-05-19 13:43:34 Re: Best practice on inherited tables