Kyle Bateman <kyle(at)actarg(dot)com> writes:
> I dumped the log (-d 9) from the postmaster and the plan confirms that
> the scan is sequential when called from within the function but indexed
> when the SQL is called directly.
Yikes, that does sound like a bug.
> I'd be happy to provide a dump of the data, do other testing or whatever
> would help. I'm not sure who on the team is best to look at this.
How big would the dump file be? I'm willing to look at this, and if the
dump isn't very large then it'd be easier to just install your DB here
instead of trying to gin up my own test case.
regards, tom lane