pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
C function linkage and testing
2+ messages / 2 participants
[nested] [flat]

* C function linkage and testing
@ 2004-06-04 16:12  Andrew Gold <agold@cbamedia.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Andrew Gold @ 2004-06-04 16:12 UTC (permalink / raw)
  To: pgsql-interfaces

Hi All,

This is my first posting to the list, so please be gentle.

;-)

I'm writing a number of C SQL-extension functions and it occurred to me 
that I might need to debug these things as some point. If I want to 
create my own main () function to exercise my extensions, what Postgres 
libraries do I need to link against?

For example, the VARSIZE and VARDATA macros are wrapped around internal 
functions; palloc and pfree also have dependencies.

If I want to use these calls within my extensions, and I want to run my 
extensions separately for debugging / validation purposes, what 
libraries should I link against?

Any help is welcome.

Andrew Gold



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: C function linkage and testing
@ 2004-06-04 16:57  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Andrew Gold <agold@cbamedia.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-06-04 16:57 UTC (permalink / raw)
  To: Andrew Gold <agold@cbamedia.com>; +Cc: pgsql-interfaces

Andrew Gold <agold@cbamedia.com> writes:
> I'm writing a number of C SQL-extension functions and it occurred to me 
> that I might need to debug these things as some point. If I want to 
> create my own main () function to exercise my extensions, what Postgres 
> libraries do I need to link against?

There are no libraries for backend internal functions, and I doubt that
it would make any sense to provide such.  (By the time you got done
duplicating the behavior of palloc and elog, you'd have a mini-backend
anyway --- you'd certainly not have a "library" that could be plugged
into any random main program.)

Usually people who want to debug such stuff just attach to a running
backend with a debugger, and debug the code in the live environment.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-06-04 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-06-04 16:12 C function linkage and testing Andrew Gold <agold@cbamedia.com>
2004-06-04 16:57 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox