pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
perl return codes
2+ messages / 2 participants
[nested] [flat]

* perl return codes
@ 2001-02-27 00:06 jr@i-bucks.com
  2001-02-27 01:18 ` Re: perl return codes selkovjr@mcs.anl.gov
  0 siblings, 1 reply; 2+ messages in thread

From: jr@i-bucks.com @ 2001-02-27 00:06 UTC (permalink / raw)
  To: pgsql-interfaces

I am writing a few perl scripts accessing postgres.   I have used the
examples in Bruce Momjian's book, where command results are tested.
(Variables such as PGRES_CONNECTION_OK and PGRES_TUPLES_OK are used).
Where can I find documentation on these types of variables, for other
commands?  (source is okay, I just cannot find it).  

thanks,
jr
john riehl





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

* Re: perl return codes
  2001-02-27 00:06 perl return codes jr@i-bucks.com
@ 2001-02-27 01:18 ` selkovjr@mcs.anl.gov
  0 siblings, 0 replies; 2+ messages in thread

From: selkovjr@mcs.anl.gov @ 2001-02-27 01:18 UTC (permalink / raw)
  To: jr@i-bucks.com; +Cc: pgsql-interfaces

> I am writing a few perl scripts accessing postgres.   I have used the
> examples in Bruce Momjian's book, where command results are tested.
> (Variables such as PGRES_CONNECTION_OK and PGRES_TUPLES_OK are used).
> Where can I find documentation on these types of variables, for other
> commands?  (source is okay, I just cannot find it).  

These are not exactly variables -- they are the calls to autoloaded
subroutines exported into your name space, so they appear to be
constants. Their values are defined in Pg.xs, in constant().

If you were asking about their meaning, I believe their names are
self-explanatory, but maybe I've just been around for too long. Look
for comments in libpq-fe.h, and if something is still unclear, be sure
to ask again.

Also, consider using DBI. It has a somewhat cleaner interface and its
error handling model is simpler, too. It's just an opinion, of
course. I once had to convert some of my code from Pg to DBI because
my users were high on portability. Nevermind that I never achieved
portablity (because many of the features I use are unique to
postgres). I but I liked it and still stick to it. I have a feeling
that it allows me to code faster and achieve greater sophistication.

--Gene





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


end of thread, other threads:[~2001-02-27 01:18 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-27 00:06 perl return codes jr@i-bucks.com
2001-02-27 01:18 ` selkovjr@mcs.anl.gov

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