C function fails afeter create extension but ok after reconnect - Mailing list pgsql-general

From Stephen Woodbridge
Subject C function fails afeter create extension but ok after reconnect
Date
Msg-id 51991219.8040508@gmail.com
Whole thread Raw
Responses Re: C function fails afeter create extension but ok after reconnect
List 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


pgsql-general by date:

Previous
From: Toby Corkindale
Date:
Subject: Re: Deploying PostgreSQL on CentOS with SSD and Hardware RAID
Next
From: Toby Corkindale
Date:
Subject: Re: Deploying PostgreSQL on CentOS with SSD and Hardware RAID