/*
# pgSelect : $Revision$  
# $Date$ 
# Created by $Author$
# Usage : pgSelect
# Attention
#   $Loccker$
#  	$State$ 
#
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>                  
#define GLOBAL_DECLARATION
#include "../inc/config.h"
#include <pgsql/libpq-fe.h>
#define DEBUG
#include "genUtil.h"

/*
Example:
typedef struct lpgSelectInfo {
	float a;
	int   b;
} lpgSelectInfo;

typedef enum lpgSelectMode {
	a=0,
	b=1
} lpgSelectMode;
*/

int
main(int argc, char* argv[]) 
{

	PGconn* con;
	PGresult* res;


	pgSelectInfo info;

	init0(&info);
    argCheck(&info, argc, argv);
    init1(&info);

	DEBUGPRINT("Program Start\n");

	con= PQsetdb(info.hostname, info.port, NULL, NULL, info.dbName);
	
	if (PQstatus(con) == CONNECTION_BAD) {
	  fprintf(stderr, "Connection to database '%s' on %s failed.\n",info.dbName, info.hostname);
	  fprintf(stderr, "%s" , PQerrorMessage(con));
	  exit(1);
	}
	
	
	//	PQsetdb(info.hostname,"info.port",NULL,NULL,"info.dbName");
	exit(EXIT_SUCCESS);
	
	
}

void
additionalUsage()
{
	fprintf(stderr, "----- Additional Usage -----\n");
}
