Commit Graph

171 Commits

Author SHA1 Message Date
Tom Lane
092133beb3 Okay, I've had it with PQsetdbLogin having slightly different defaults
than PQconnectdb.  Reimplement the former to use the same code as the
latter.  Fix documentation omissions while at it.
2003-04-28 04:29:12 +00:00
Tom Lane
5ed27e35f3 Another round of protocol changes. Backend-to-frontend messages now all
have length words.  COPY OUT reimplemented per new protocol: it doesn't
need \. anymore, thank goodness.  COPY BINARY to/from frontend works,
at least as far as the backend is concerned --- libpq's PQgetline API
is not up to snuff, and will have to be replaced with something that is
null-safe.  libpq uses message length words for performance improvement
(no cycles wasted rescanning long messages), but not yet for error
recovery.
2003-04-22 00:08:07 +00:00
Tom Lane
bd8d441775 Second round of FE/BE protocol changes. Frontend->backend messages now
have length counts, and COPY IN data is packetized into messages.
2003-04-19 00:02:30 +00:00
Tom Lane
cb7fb3ca95 First phase of FE/BE protocol modifications: new StartupPacket layout
with variable-width fields.  No more truncation of long user names.
Also, libpq can now send its environment-variable-driven SET commands
as part of the startup packet, saving round trips to server.
2003-04-17 22:26:02 +00:00
Peter Eisentraut
5e5c5cd31a Merge documentation into one book. (Build with "make html".) Replace
vague cross-references with real links.
2003-03-25 16:15:44 +00:00
Bruce Momjian
f1792b932c Use PQfreemem() consistently, and document its use for Notify.
Keep PQfreeNotify() around for binary compatibility.
2003-03-25 02:44:36 +00:00
Bruce Momjian
8670e3588f Prevent multiple queries in a single string into a single transaction
when autocommit is off, and document grouping when autocommit is on.
2003-03-24 18:33:52 +00:00
Bruce Momjian
23ecb8855d Add PQfreemem() call for Win32. 2003-03-22 03:29:06 +00:00
Bruce Momjian
44aba28020 PGRES_POLLING_ACTIVE is unused, keep for backward compatibility.
Lennert Buytenhek
2003-03-20 06:23:30 +00:00
Peter Eisentraut
706a32cdf6 Big editing for consistent content and presentation. 2003-03-13 01:30:29 +00:00
Bruce Momjian
81f6db4803 Allow PQcmdTuples to return row counts for MOVE and FETCH.
Neil Conway
2003-02-19 03:59:02 +00:00
Bruce Momjian
c5f8cbf9f5 Fix broken markup I just introduced. 2003-02-14 02:21:25 +00:00
Bruce Momjian
77cf4a133c Properly document location of pg_service.conf.sample. 2003-02-14 01:32:31 +00:00
Bruce Momjian
0064031f99 This patch fixes an error in the usage message for 'clusterdb', and
makes a few editorial changes to the documentation.


Neil Conway
2003-02-13 05:37:44 +00:00
Tom Lane
4ec457ad58 Fix regression in .pgpass support. From Neil Conway. 2003-01-30 19:49:54 +00:00
Bruce Momjian
be2b660ecd This patch includes a lot of minor cleanups to the SGML documentation,
including:

- replacing all the appropriate usages of <citetitle>PostgreSQL
...</citetitle> with &cite-user;, &cite-admin;, and so on

- fix an omission in the EXECUTE documentation

- add some more text to the EXPLAIN documentation

- improve the PL/PgSQL RETURN NEXT documentation (more work to do here)

- minor markup fixes


Neil Conway
2003-01-19 00:13:31 +00:00
Bruce Momjian
c859cda782 Document libpq service capability, and add sample file. 2003-01-07 04:25:29 +00:00
Bruce Momjian
c9cf982038 Enable IPv6 libpq 'hostaddr' addresses. Update docs. 2003-01-06 22:48:16 +00:00
Bruce Momjian
e60b5d5306 This patch fixes a few typos in the documentation for the '~/.pgpass'
libpq feature.

Neil Conway
2002-12-13 05:49:10 +00:00
Bruce Momjian
da8149032a SGML improvements.
Neil Conway
2002-11-15 03:11:18 +00:00
Peter Eisentraut
1b342df00a Merge documentation updates from 7.3 branch. 2002-11-11 20:14:04 +00:00
Bruce Momjian
4ca28eb7c7 I just discovered, that there is missing a const when passing a buffer
to  PQescapeBytea and PQunescapeBytea. I fixed it and tried to create a
usable  diff (I'm not so familar to diff).

Tommi M?kitalo
2002-11-10 00:14:22 +00:00
Bruce Momjian
88f528c3e9 Update libpq PQcmdTuples() and PQcmdStatus() docs, remove const param
doc mention to match code and include files.
2002-11-08 05:03:11 +00:00
Bruce Momjian
ba95f2d6aa This patch adds information to the documentation on .pgpass and creates
additional index entries for it.

Oliver Elphick
2002-11-03 01:30:46 +00:00
Peter Eisentraut
bc49968764 Add more appropriate markup. 2002-09-21 18:32:54 +00:00
Bruce Momjian
cd06c70d9a Missed mention of PGPASSWORDFILE. 2002-09-05 22:09:42 +00:00
Bruce Momjian
5fc10c3d17 Remove PGPASSWORDFILE and default to always trying $HOME/.pgpass.
Cleanup up memory allocation for $HOME in related psql places.

Update mention of $HOME/.pgpass in the docs;  add mention in pg_dumpall.
2002-09-05 22:05:50 +00:00
Tom Lane
b356b969ef Fix obsolete description of PGnotify struct. 2002-09-02 20:21:32 +00:00
Bruce Momjian
f0ed4311b6 Add libpq connection timeout parameter.
Denis A Ustimenko
2002-08-17 12:33:18 +00:00
Bruce Momjian
1276356268 PostgreSQL 7.2.1 Documentation
Chapter 1. libpq - C Library
1.3. Command Execution Functions
1.3.3. Escaping binary strings for inclusion in SQL queries

I found the line
"The result string length does not include the terminating zero byte of the result."
is not right.
The result string length does indeed include the terminating zero byte.

Christoph Haller
2002-08-15 03:00:59 +00:00
Bruce Momjian
7f4981f4af I'm giving a try at some TODO items. Currently it's the turn of the
PGPASSWORDFILE environment variable.  I have modified libpq to make use
of this variable.  I present the first cut here.

Currently the format for the file should be

host:port:database:user:password

Alvaro Herrera
2002-08-15 02:56:19 +00:00
Peter Eisentraut
b6ea172ace Spell checking and markup additions 2002-03-22 19:20:45 +00:00
Peter Eisentraut
d0d3ab5325 Fix markup 2002-03-11 05:03:52 +00:00
Bruce Momjian
294f0d4bd6 Add PQunescapeBytea libpq function.
Everyone using libpq and bytea is probably having to invent this wheel..

Patrick Welche
2002-03-04 23:59:14 +00:00
Bruce Momjian
a724463c8a Improve non-thread-safe mention of libpq's crypt. 2002-01-18 20:39:04 +00:00
Bruce Momjian
9600ccad13 Improve description of autocommit behavior in ecpg manual pages. 2002-01-18 20:32:54 +00:00
Peter Eisentraut
731204e090 Editorial review 2002-01-07 02:29:15 +00:00
Peter Eisentraut
d5aa0dc8db Improve wording 2001-11-29 16:01:15 +00:00
Bruce Momjian
cde7dc82ca Mention ps environment flag, not just -e. 2001-11-28 20:36:09 +00:00
Bruce Momjian
4ee2698d0e Update 'ps e' comments. 2001-11-28 20:28:56 +00:00
Bruce Momjian
534af30cfd Document that PGPASSWORD is not secure. 2001-11-28 19:57:36 +00:00
Tom Lane
6c134eb6f1 Spell 'precedes', 'preceding' correctly in various places. 2001-11-21 22:57:01 +00:00
Thomas G. Lockhart
2475e87481 Deprecate 'current' for date/time input.
Fix up references to "PostgreSQL" rather than "Postgres". Was roughly
 evenly split between the two before. ref/ files not yet done.
2001-11-21 05:53:41 +00:00
Bruce Momjian
004293317f Here's a patch adding documentation for the PQescapeBytea function to
libpq.sgml

I was trying (but gave up) to cross-reference back to the input escape
table in the User's Guide, but could not get the documentation to
compile with a cross-book xref (missing IDREF error). Can a cross-book
xref be done?

 Joe Conway
2001-11-20 20:28:31 +00:00
Tom Lane
9b03776ff2 A bunch of small doco updates motivated by scanning the comments on
the interactive docs.
2001-11-19 03:58:25 +00:00
Tom Lane
acac465efa utils/geo-decls.h should be utils/geo_decls.h, per report from
StÅphane Raimbault.
2001-11-18 21:28:00 +00:00
Peter Eisentraut
3c879e3738 Add some more index entries. 2001-11-12 19:19:39 +00:00
Peter Eisentraut
d63805a469 A little reformatting for better print appearance. 2001-10-31 20:39:30 +00:00
Bruce Momjian
705869dd17 Uppercase keywords where appropriate. 2001-10-12 23:32:34 +00:00
Peter Eisentraut
351a0c1736 Replace ASCII-quotes with proper markup. 2001-09-13 15:55:24 +00:00
Peter Eisentraut
a457d33516 Markup and spell-check run over Programmer's Guide (rather incomplete still). 2001-09-10 21:58:47 +00:00
Peter Eisentraut
1a63ef056e fix markup 2001-09-08 16:46:34 +00:00
Bruce Momjian
1834987fb6 I've attached the fixed version of the patch below. After the
discussion on pgsql-hackers (especially the frightening memory dump in
<12273.999562219@sss.pgh.pa.us>), we decided that it is best not to
use identifiers from an untrusted source at all.  Therefore, all
claims of the suitability of PQescapeString() for identifiers have
been removed.

Florian Weimer
2001-09-07 22:02:32 +00:00
Peter Eisentraut
ff5e8a26a2 Fix typo. 2001-09-04 00:18:18 +00:00
Peter Eisentraut
f5944af8ba Include directory rearrangement
Client headers are no longer in a subdirectory, since they have been made
namespace-clean.

Internal libpq headers are in a private subdirectory.

Server headers are in a private subdirectory.  pg_config has a new option
to point there.
2001-08-28 14:20:28 +00:00
Tom Lane
135dea6322 Since PQoidStatus is deprecated, we should probably stop using it in
our own code ...
2001-08-10 22:50:10 +00:00
Bruce Momjian
24641335cf The portion about the PQgetssl() function in the libpq documentation
appears to be duplicated (two identical <listitems> right after each
other). Here is a quick patch to remove one instance of it.

Magnus Hagander
2001-08-10 14:42:47 +00:00
Tom Lane
6d0d838ceb Remove WIN32_NON_BLOCKING_CONNECTIONS tests, since we don't need 'em
anymore.
2001-07-31 02:14:49 +00:00
Peter Eisentraut
01839df6dd Add index. Only some parts of the manual set have index entries so far... 2001-05-12 22:51:36 +00:00
Peter Eisentraut
4f268b01cd More markup fixes 2001-05-01 10:48:57 +00:00
Tom Lane
955c8771f8 Repair freshly-broken markup. 2001-04-30 22:21:22 +00:00
Bruce Momjian
60ba30d13a Break up PQexec() result functions into subsections to be clearer. Both
libpq and libpq++ reorganized.
2001-04-30 17:38:00 +00:00
Peter Eisentraut
6cf8707b82 correction 2001-03-21 19:09:03 +00:00
Peter Eisentraut
5bbad66e0e PyGreSQL documentation. Based on the README, converted to DocBook by
Mikhail Terekhov <terekhov@emc.com>.
2001-03-04 18:54:07 +00:00
Peter Eisentraut
74bbe8097d Replace some oldish, non-SQL'ish elements with more standard forms. (cast
syntax, type names, function names, etc.)
2001-01-20 20:59:29 +00:00
Thomas G. Lockhart
6439de1752 Fix incorrect placeholder name in example. 2001-01-18 07:18:39 +00:00
Peter Eisentraut
027f144e39 Terminology cleanup: class -> table, instance -> row, attribute -> column,
etc.
2001-01-13 23:58:55 +00:00
Tom Lane
0a8da82576 Correct erroneous documentation of PQsetnonblocking(). 2000-12-28 00:16:11 +00:00
Peter Eisentraut
1b555ce791 Replace incorrect uses of 'which' with 'that'. (so-called "wicked which") 2000-12-22 18:57:50 +00:00
Bruce Momjian
1db9cce39f responce->response
Alfred Perlstein
2000-12-21 18:47:05 +00:00
Tom Lane
b7c3784417 Repair residual sillinesses from UUNET virtual host/socket path patch.
I hope all the dust has settled out now ...
2000-11-30 23:20:51 +00:00
Peter Eisentraut
59a9735fc8 Sort out things after fe-connect.c cleanup after unix socket patch. 2000-11-30 18:34:36 +00:00
Bruce Momjian
5173fc411f Remove PQunixsocket, per Peter's recommendation. PQhost shows the socket directory. 2000-11-28 06:53:33 +00:00
Bruce Momjian
98e195d23b Make socket option specify just the directory, not the full path. 2000-11-22 01:41:14 +00:00
Bruce Momjian
8f3b2b3a5c Add mention of new leading-slash handling of hostname to libpq docs. 2000-11-14 01:53:37 +00:00
Bruce Momjian
ebd61ac03f Remove -k unix socketpath option from client side, allow hostname with
leading slash to behave as a unix socket path.
2000-11-13 23:37:54 +00:00
Bruce Momjian
2150c2edf1 UUNET is looking into offering PostgreSQL as a part of a managed web
hosting product, on both shared and dedicated machines.  We currently
offer Oracle and MySQL, and it would be a nice middle-ground.
However, as shipped, PostgreSQL lacks the following features we need
that MySQL has:

1. The ability to listen only on a particular IP address.  Each
   hosting customer has their own IP address, on which all of their
   servers (http, ftp, real media, etc.) run.
2. The ability to place the Unix-domain socket in a mode 700 directory.
   This allows us to automatically create an empty database, with an
   empty DBA password, for new or upgrading customers without having
   to interactively set a DBA password and communicate it to (or from)
   the customer.  This in turn cuts down our install and upgrade times.
3. The ability to connect to the Unix-domain socket from within a
   change-rooted environment.  We run CGI programs chrooted to the
   user's home directory, which is another reason why we need to be
   able to specify where the Unix-domain socket is, instead of /tmp.
4. The ability to, if run as root, open a pid file in /var/run as
   root, and then setuid to the desired user.  (mysqld -u can almost
   do this; I had to patch it, too).

The patch below fixes problem 1-3.  I plan to address #4, also, but
haven't done so yet.  These diffs are big enough that they should give
the PG development team something to think about in the meantime :-)
Also, I'm about to leave for 2 weeks' vacation, so I thought I'd get
out what I have, which works (for the problems it tackles), now.

With these changes, we can set up and run PostgreSQL with scripts the
same way we can with apache or proftpd or mysql.

In summary, this patch makes the following enhancements:

1. Adds an environment variable PGUNIXSOCKET, analogous to MYSQL_UNIX_PORT,
   and command line options -k --unix-socket to the relevant programs.
2. Adds a -h option to postmaster to set the hostname or IP address to
   listen on instead of the default INADDR_ANY.
3. Extends some library interfaces to support the above.
4. Fixes a few memory leaks in PQconnectdb().

The default behavior is unchanged from stock 7.0.2; if you don't use
any of these new features, they don't change the operation.

David J. MacKenzie
2000-11-13 15:18:15 +00:00
Bruce Momjian
d3f6552821 Remove duplicate requiressl entry. 2000-10-17 14:27:50 +00:00
Bruce Momjian
06dc338ee9 Here is a patch against the same cvs tree as the SSL patch (Aug 20).
I hope I didn't mess the SGML up too bad, but somebody should definitly
look that over. I tried to steal as much as I could from around :-)

This patch updates:
* Installation instructions (paragraph on how to compile with openssl)
* Documentation of pg_hba.conf (added "hostssl" record docs)
* Libpq documentation (added connection option, documentation of
  PQgetssl() function)
* Add section on SSL to "Server Runtime Environment"

If you beleive any particular area needs more attention, please let me know.

//Magnus
2000-10-16 03:25:17 +00:00
Peter Eisentraut
7c5a444f53 Treat empty connection parameters as is, in particular to enable overriding
environment variables with "nothing".  Empty host parameter indicates
Unix socket.
2000-10-03 19:16:17 +00:00
Peter Eisentraut
72ad5fe15c Add id' attributes to all chapter' and `sect1' tags, to generate useful
names for the HTML files (e.g., not x4856.htm).
2000-09-29 20:21:34 +00:00
Bruce Momjian
67cd018e77 Startup is actually start-up. 2000-08-29 20:02:09 +00:00
Bruce Momjian
c51041f4ba Here is a patch against the same cvs tree as the SSL patch (Aug 20).
I hope I didn't mess the SGML up too bad, but somebody should definitly
look that over. I tried to steal as much as I could from around :-)

This patch updates:
* Installation instructions (paragraph on how to compile with openssl)
* Documentation of pg_hba.conf (added "hostssl" record docs)
* Libpq documentation (added connection option, documentation of
  PQgetssl() function)
* Add section on SSL to "Server Runtime Environment"

If you beleive any particular area needs more attention, please let me know.

//Magnus
2000-08-29 04:15:43 +00:00
Thomas G. Lockhart
45f79cae14 Fixups in content and markup for 7.0 release. 2000-05-02 20:02:03 +00:00
Bruce Momjian
1234981836 Fix libpq example return values 2000-04-25 16:39:07 +00:00
Thomas G. Lockhart
73d8bbc2ac Minor markup changes. Refer to (".../catalog") in the emacs hints. 2000-03-31 03:27:42 +00:00
Tom Lane
cb3b3eda9a In PQnotifies discussion, reference PQsocket as function needed to get
file descriptor number for select().  (Suggestion from Ken Wright.)
2000-03-26 01:00:17 +00:00
Tom Lane
0edcee3459 Fold PQsetenv working state into PGconn, rather than trying to maintain
it in a separate object.  There's no value in keeping the state separate,
and it creates dangling-pointer problems.  Also, remove PQsetenv routines
from public API, until and unless they are redesigned to have a safer
interface.  Since they were never part of the documented API before 7.0,
it's unlikely that anyone is calling them.
2000-03-24 01:39:55 +00:00
Tom Lane
370186e807 Update libpq documentation for PQconndefaults() change. Add section
about thread-safeness of the library.
2000-03-11 03:09:28 +00:00
Tom Lane
b1577a7c78 New cost model for planning, incorporating a penalty for random page
accesses versus sequential accesses, a (very crude) estimate of the
effects of caching on random page accesses, and cost to evaluate WHERE-
clause expressions.  Export critical parameters for this model as SET
variables.  Also, create SET variables for the planner's enable flags
(enable_seqscan, enable_indexscan, etc) so that these can be controlled
more conveniently than via PGOPTIONS.

Planner now estimates both startup cost (cost before retrieving
first tuple) and total cost of each path, so it can optimize queries
with LIMIT on a reasonable basis by interpolating between these costs.
Same facility is a win for EXISTS(...) subqueries and some other cases.

Redesign pathkey representation to achieve a major speedup in planning
(I saw as much as 5X on a 10-way join); also minor changes in planner
to reduce memory consumption by recycling discarded Path nodes and
not constructing unnecessary lists.

Minor cleanups to display more-plausible costs in some cases in
EXPLAIN output.

Initdb forced by change in interface to index cost estimation
functions.
2000-02-15 20:49:31 +00:00
Thomas G. Lockhart
f0c66e539b Fix extraneous ending tag on libpq.sgml.
Renormalize query.sgml and fix indenting.
2000-02-15 03:57:02 +00:00
Peter Eisentraut
9ceb5d8a7b Fixed psql double quoting of SQL ids
Fixed libpq printing functions
2000-02-07 23:10:11 +00:00
Thomas G. Lockhart
215935daa3 Remove extraneous end tag. Code now compiles cleanly. 2000-02-02 16:23:37 +00:00
Peter Eisentraut
2b84cbb60f A few minor psql enhancements
Initdb help correction
Changed end/abort to commit/rollback and changed related notices
Commented out way old printing functions in libpq
Fixed a typo in alter table / alter column
2000-01-29 16:58:54 +00:00
Tom Lane
90aaad06cf Remove obsolete references to 8K query limit. 2000-01-25 07:04:04 +00:00
Bruce Momjian
10d7287ab9 Libpq non-blocking mode, from Alfred Perlstein 2000-01-18 06:09:24 +00:00
Tom Lane
2af360ed1c Clean up some problems in new asynchronous-connection logic
in libpq --- mostly, poor response to error conditions.  You now actually
get to see the postmaster's 'The Data Base System is starting up' message,
which you didn't before.  I suspect the SSL code is still broken though.
2000-01-14 05:33:15 +00:00
Thomas G. Lockhart
b7f6168516 Fix markup (a couple of missing tags) and renormalize. 1999-12-06 16:38:25 +00:00
Bruce Momjian
3ab5b1f1e6 This patch (against the current CVS sources) adds to libpq the functions
PQconnectStart
PQconnectPoll
PQresetStart
PQresetPoll
PQsetenvStart
PQsetenvPoll
PQsetenvAbort

and brings into the published interface

PQsetenv.

The first four are asynchronous analogues of PQconnectdb and PQreset -
they allow an application to connect to the DB without blocking on
remote I/O.

The PQsetenv functions perform an environment negotiation with the
server.

Internal to libpq, pqReadReady and pqWriteReady have been made available
across the library (they were previously static functions inside
fe-misc.c).  A lot of internal rearrangement has been necessary to
support these changes.

The API documentation has been updated also.

Caveats:

  o  The Windows code does not default to using non-blocking sockets,
since I have no documentation: Define WIN32_NON_BLOCKING_CONNECTIONS to
do that.

  o  The SSL code still blocks.


Ewan Mellor.
1999-11-30 03:08:19 +00:00
Bruce Momjian
6b99fcf3e2 Update for documentation in libpq changes. 1999-11-11 21:52:28 +00:00