How to refer to resource files from UDFs written in C

From: Supun Nakandala <supun(dot)nakandala(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: How to refer to resource files from UDFs written in C
Date: 2017-06-09 05:56:32
Message-ID: CAFwzmVApFqe2DrG6-VmELKuwk96ftXn89nSE3X6GeAMRJosh4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I am trying to extend PostgreSQL by adding UDT and UDF for a custom use
case and I am using C language extensions to do that.

However, I have a requirement of reading a text file from one of the C
functions. The compiled *.so files are placed in the "pg_config
--pkglibdir" directory and tried copying my text files there but it didn't
work. I found that, when these shared libs are loaded they are run from a
different working directory. In this case, what is the best way to refer to
my text files from the C code other than giving the absolute path which can
change from system to system.

Thank you.
Supun

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2017-06-09 06:04:31 Re: walsender & parallelism
Previous Message Amit Langote 2017-06-09 05:01:34 Re: A bug in mapping attributes in ATExecAttachPartition()