473,774 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

undefined reference to 'pg_detoast_dat um'

In PostgreSQL 7.2 (Redhat 7.3 version, so it is patched), I'm trying to
create a Version-1 C server extension. The Version-0 format works, the
Version-1 version fails with:
undefined reference to 'pg_detoast_dat um'

According to docs at:
http://www.postgresql.org/docs/7.2/i...e/xfunc-c.html

....by using Version-1 the pg_detoast_datu m is no longer needed. FYI, the
function being created takes and returns a text argument. Are the docs
there wrong, or is there a bug in the library build, that causes
Version-1 to require linking to a lib with pg_detoast_datu m?

A google search shows very little concerning the pg_detoast_datu m
undefined reference link error. It is looking more like the V1 has to be
skipped and I'll have to go back to V0 if I can't get this to work. [and
unless someone can magically make the default PostgreSQL version on RH
7.3 change to a newer version of PostgreSQL, then a newer version can't
be used]

D. Stimits
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 12 '05 #1
2 2843
D. Stimits wrote:
A google search shows very little concerning the pg_detoast_datu m
undefined reference link error. It is looking more like the V1 has to be
skipped and I'll have to go back to V0 if I can't get this to work.
You haven't shown us your function, so it's a bit difficult to help, but
in any case you do *not* want to use the V0 calling conventions -- they
are deprecated and subject to removal in the future. V1 certainly works
-- I've done many V1 C functions that accept text arguments. Take a look
at some of the contrib folder extensions if you need examples.
unless someone can magically make the default PostgreSQL version on RH
7.3 change to a newer version of PostgreSQL, then a newer version can't
be used]


Why not? I have Postgres 7.3.4 running on my RH 7.3 server. Here are RH
7.3 RPMs:
ftp://ftp8.us.postgresql.org/pub/pgs...MS/redhat-7.3/

Joe

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #2
Joe Conway wrote:
D. Stimits wrote:
A google search shows very little concerning the pg_detoast_datu m
undefined reference link error. It is looking more like the V1 has to
be skipped and I'll have to go back to V0 if I can't get this to work.

You haven't shown us your function, so it's a bit difficult to help, but
in any case you do *not* want to use the V0 calling conventions -- they
are deprecated and subject to removal in the future. V1 certainly works
-- I've done many V1 C functions that accept text arguments. Take a look
at some of the contrib folder extensions if you need examples.
unless someone can magically make the default PostgreSQL version on RH
7.3 change to a newer version of PostgreSQL, then a newer version
can't be used]

Why not? I have Postgres 7.3.4 running on my RH 7.3 server. Here are RH
7.3 RPMs:
ftp://ftp8.us.postgresql.org/pub/pgs...MS/redhat-7.3/


I'll consider this, but it greatly complicates things to require users
add the non-redhat version. I understand the benefits of doing so, but
convincing people to do this just to try out a package is not so easy.

Joe

Here is a simple echo function that is being used:

#include <pgsql/server/postgres.h>
#include <string.h>
#include <pgsql/server/fmgr.h>

PG_FUNCTION_INF O_V1(reverse_pa th);
Datum my_echo(PG_FUNC TION_ARGS)
{
text* arg = PG_GETARG_TEXT_ P(0);
text* echo_arg = (text *)palloc(sizeof (arg));

memcpy(
(void *)(echo_arg),
(void *)(arg),
sizeof(arg)
);

PG_RETURN_TEXT_ P(echo_arg);
}
Keep in mind that this isn't being run yet, it fails at link stage. As
another test, I have simplified the above just to test link time (not
intended to run, just as a test of link/compile):

#include <pgsql/server/postgres.h>
#include <pgsql/server/fmgr.h>

PG_FUNCTION_INF O_V1(reverse_pa th);
Datum my_echo(PG_FUNC TION_ARGS)
{
text* arg = PG_GETARG_TEXT_ P(0);

PG_RETURN_TEXT_ P(arg);
}
The first function complains at link time of missing link function
pg_detoast_datu m, CurrentMemoryCo ntext, and MemoryContextAl loc, while
the latter complains only of missing pg_detoast_datu m.

In both cases, link libraries are:
-lkrb5 -lk5crypto -lcom_err -lpq -ldl

Now I am still scratching my head, wondering how it is that
pg_detoast_datu m is a V0 function, and I can compile V0 libraries just
fine, but can't even compile a V1, which supposedly does not use
pg_detoast_data ? The additional link failures when using palloc make me
feel there is some mysterious unnamed library that is missing when using
V1, aside from -lpq. When I go in to compile the src/test/regress/
directory of the source from the rpm used in Redhat 7.3, I see no signs
that anything else is required. Something simple must be missing under
the PostgreSQL 7.2 version. Is there a separate library that needs
linking under a V1 interface, in addition to those named above?

D. Stimits
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
13125
by: RU | last post by:
Hi, I am working on a porting project to port C/C++ application from unixware C++, AT&T Standard components to g++ with STL on Linux. This application has been working properly on Unixware/C++/AT&T componets environment. I have been able to compile all modules after making necessary changes in LINUX/gcc/STL environment. We have two templates defined XList and XMap.
13
3367
by: david | last post by:
Hi, I have some problems to link a simple hello world program using g++ (version 3.2.3 or 3.3) and dinkumware 402. //hallo world... #include <iostream> main () { std::cout << "bla" << std::endl; }
1
3151
by: Codemutant | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** I just cannot find what is undefined in this code.
1
9612
by: Foolster41 | last post by:
I'm rather new to C++ programing. I'm using the dev-C++ program on a windows XP OS. I'm trying to compile the code for a multi user dungeon (MUD) called circle-mud. When I compile I get the following errors: ---- Compiler: Default compiler Building Makefile: "C:\EvoMud\circle-3.1\src\Makefile.win" Executing make...
1
31203
by: Dom | last post by:
I'm new to c++. Just started learning it 24 hours ago. Am running into a compile problem. Please, no one waste the effort telling me to google it. I've been researching it for quite a while with no joy. I got dev-c++ and a bit of winsock sample code. I've done nothing out of the ordinary. I could only assume that anyone else that downloaded this software and attempted this would meet with the same result. The problem lies with either the...
3
789
by: Michael Sgier | last post by:
Hi i get thousands of messages like below. How shall i resolve that? Thanks Mcihael Release/src/Utility/RawImage.o: In function `CMaskImage::CMaskImage(int, int, char const*)': RawImage.cpp:(.text+0x15dc): undefined reference to `popen(PFS*, char const*)'
45
4861
by: VK | last post by:
(see the post by ASM in the original thread; can be seen at <http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/3716384d8bfa1b0b> as an option) As that is not in relevance to "new Array() vs " question or to the array performance, I dared to move it to a new thread. Gecko takes undefined value strictly as per Book 4, Chapter 3, Song 9 of Books of ECMA :-)
3
11601
by: prakash.mirji | last post by:
Hello, I am getting below mention linker error when I tried to link my class test.C I use below command to compile test.C /usr/bin/g++ -g -fpic -fvisibility=default -D_POSIX_SOURCE -DTRACING - D__EXTENSIONS__ -D__RWCOMPILER_H__ -D_REENTRANT -D_RWCONFIG=8s - D_RWCONFIG_12d -D_RWSTDDEBUG -DRWDEBUG -o test1 test1.o -L/lib -
2
6228
by: zqiang320 | last post by:
Hello: I execute make ,then get error: $ make Making all in libsbml/src make: Entering directory `/home/internet/mydoc/test_pj/libsbml/src' ........ /bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -o test test.o libsbml/src/libsbml.la -lsbml -lstdc++ -lm
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.