[HACKERS] How to refer to resource files from UDFs written in C

Поиск
Список
Период
Сортировка
От Supun Nakandala
Тема [HACKERS] How to refer to resource files from UDFs written in C
Дата
Msg-id CAFwzmVApFqe2DrG6-VmELKuwk96ftXn89nSE3X6GeAMRJosh4w@mail.gmail.com
обсуждение исходный текст
Ответы Re: [HACKERS] How to refer to resource files from UDFs written in C  (Heikki Linnakangas <hlinnaka@iki.fi>)
Re: [HACKERS] How to refer to resource files from UDFs written in C  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Langote
Дата:
Сообщение: Re: [HACKERS] A bug in mapping attributes in ATExecAttachPartition()
Следующее
От: Noah Misch
Дата:
Сообщение: Re: [HACKERS] walsender & parallelism