pgsqldb.c revision ec5347e2c775f027573ce5648b910361aa926c01
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * Copyright (C) 2000, 2001 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * Permission to use, copy, modify, and/or distribute this software for any
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * purpose with or without fee is hereby granted, provided that the above
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews * copyright notice and this permission notice appear in all copies.
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews/* $Id: pgsqldb.c,v 1.14 2007/06/18 23:47:33 tbox Exp $ */
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * A simple database driver that interfaces to a PostgreSQL database. This
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * is not complete, and not designed for general use. It opens one
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * connection to the database per zone, which is inefficient. It also may
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * not handle quoting correctly.
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * The table must contain the fields "name", "rdtype", and "rdata", and
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * is expected to contain a properly constructed zone. The program "zonetodb"
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * creates such a table.
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrewspgsqldb_destroy(const char *zone, void *driverdata, void **dbdata);
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * Canonicalize a string before writing it to the database.
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews * "dest" must be an array of at least size 2*strlen(source) + 1.
08e36aa5a5c7697a839f83831fccf8fb3f792848Mark Andrews while (*source != 0) {
*dest++ = 0;
static isc_result_t
return (ISC_R_SUCCESS);
return (ISC_R_FAILURE);
static isc_result_t
return (ISC_R_SUCCESS);
static isc_result_t
char *canonname;
return (ISC_R_NOMEMORY);
return (result);
return (ISC_R_FAILURE);
return (ISC_R_NOTFOUND);
char *endp;
return (DNS_R_BADTTL);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
static isc_result_t
return (result);
return (ISC_R_FAILURE);
return (ISC_R_NOTFOUND);
char *endp;
return (DNS_R_BADTTL);
return (ISC_R_FAILURE);
return (ISC_R_SUCCESS);
static isc_result_t
return (ISC_R_FAILURE);
return (ISC_R_NOMEMORY);
goto cleanup; \
goto cleanup;
return (ISC_R_SUCCESS);
return (result);
pgsqldb_init(void) {
unsigned int flags;
flags = 0;
pgsqldb_clear(void) {