Whoops, sorry, there was another reason for the segfault. Using MyProc->databaseId works. Is it the right way to do it, though?

Markus Schiltknecht wrote:
Hi,

how can I get the database name or OID of the current backend in a SPI function (in plain C)? I tried including storage/proc.h and accessing MyProc->databaseId, but that leads to a segfault :-( (and seems like the wrong way to do it.)

The SPI documentation didn't help.

Thank you

Markus

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to