pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Help!
20+ messages / 18 participants
[nested] [flat]

* Help!
@ 1998-05-06 16:10 Conrado Miguel Rodriguez Fernandez <conrado@Horus.aeronet.cu>
  0 siblings, 0 replies; 20+ messages in thread

From: Conrado Miguel Rodriguez Fernandez @ 1998-05-06 16:10 UTC (permalink / raw)
  To: pgsql-interfaces


I have downloaded the ODBC driver from your ftp site
but I found no instructions on how to instal it. Sorry
but I dont use Microsoft products since long ago. Would
you wive me some HELP.

Please, Answer back to:

	 conrado%leyla.aeronet.cu@infomed.sld.cu	


Ing. Conrado Rodríguez Fernández.
E.C.A.S.A. (I.T.)





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

* HELP
@ 1998-06-23 14:55 Maxim V. Kashin <max@adv.ru>
  0 siblings, 0 replies; 20+ messages in thread

From: Maxim V. Kashin @ 1998-06-23 14:55 UTC (permalink / raw)
  To: scrappy@postgresql.org; max@adv.ru

I'm using DBI for postgreSQL.

As I can understand, included SELECT [ SELECT * FROM table1 WHERE IN
(SELECT ....)  ]
starts every time for each string of external SELECT.

How can I do that included SELECT will work only one time?

Max.






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

* help
@ 1998-06-30 19:28 ALICE@TURING.UNICAMP.BR
  0 siblings, 0 replies; 20+ messages in thread

From: ALICE@TURING.UNICAMP.BR @ 1998-06-30 19:28 UTC (permalink / raw)
  To: pgsql-interfaces

Hello
   Please, I'd like to know how can I connect to a 
PostgreSql database, using a Java language program.
Can anybody help us? 
		Thanks... Alice.



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

* help
@ 1998-11-20 06:55 Nicoleta TATARU <nicol@medanet.ro>
  0 siblings, 0 replies; 20+ messages in thread

From: Nicoleta TATARU @ 1998-11-20 06:55 UTC (permalink / raw)
  To: pgsql-interfaces@hub.org

help




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

* help
@ 1998-12-18 08:33 lijiandong <ljd@modern.org>
  0 siblings, 0 replies; 20+ messages in thread

From: lijiandong @ 1998-12-18 08:33 UTC (permalink / raw)
  To: pgsql-interfaces

Dear Sirs,

I use Postgres under RedHat5.1 linux , when I use odbc downloading from you
site recently,
it prompt me the following errors
        SQLSTATE = 28000
        Unsupported frontend protocol

I have already read your FAQ & confighelp carefully, and I could not settle
this problem
Could you please help me about this?


Best Regards,
Li Jian Dong




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

* help!
@ 1999-04-12 13:39 StOo <stuart@comodo.net>
  1999-04-12 17:37 ` Re: help! StOo <stuart@comodo.net>
  0 siblings, 1 reply; 20+ messages in thread

From: StOo @ 1999-04-12 13:39 UTC (permalink / raw)
  To: pgsql-interfaces


ive got an intresting problem with then int8 in postgres its not
actually working properly as it goes out of range with a value like
2147483648 !!!! oops i need it to go just a bit higher!!! i think the
builds naffed it up is there any way of checking this ??? any settings i
may have missed??? anyone got any more coffee????


-=-=-=StOo-=-=-=

No Reason To Live But We Like It That Way!

stuart@comodo.net Or infyalien@muddybog.force9.co.uk



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

* Re: help!
  1999-04-12 13:39 help! StOo <stuart@comodo.net>
@ 1999-04-12 17:37 ` StOo <stuart@comodo.net>
  0 siblings, 0 replies; 20+ messages in thread

From: StOo @ 1999-04-12 17:37 UTC (permalink / raw)
  To: pgsql-interfaces

StOo wrote:
> 
> ive got an intresting problem with then int8 in postgres its not
> actually working properly as it goes out of range with a value like
> 2147483648 !!!! oops i need it to go just a bit higher!!! i think the
> builds naffed it up is there any way of checking this ??? any settings i
> may have missed??? anyone got any more coffee????
> 
> -=-=-=StOo-=-=-=
> 
> No Reason To Live But We Like It That Way!
> 
> stuart@comodo.net Or infyalien@muddybog.force9.co.uk

-- 
-=-=-=StOo-=-=-=

No Reason To Live But We Like It That Way!

stuart@comodo.net Or infyalien@muddybog.force9.co.uk



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

* help
@ 1999-08-07 12:39 Alexei Gumenchuk <lesha@test.kharkov.ua>
  0 siblings, 0 replies; 20+ messages in thread

From: Alexei Gumenchuk @ 1999-08-07 12:39 UTC (permalink / raw)
  To: interfaces@postgresql.org

help




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

* Help
@ 1999-08-26 18:03 shan <shan@channel21.com>
  0 siblings, 0 replies; 20+ messages in thread

From: shan @ 1999-08-26 18:03 UTC (permalink / raw)
  To: pgsql-interfaces

I have an alpha machine, where can I find the postgres odbc driver to
install on my machine?
Shan Jiang
Channel 21 Productions Inc.
Tel: 516-821-9220



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

* help
@ 1999-12-22 20:29 Utkala Olivier <o.utkala@hrnet.fr>
  0 siblings, 0 replies; 20+ messages in thread

From: Utkala Olivier @ 1999-12-22 20:29 UTC (permalink / raw)
  To: pgsql-interfaces

help




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

* help
@ 2000-01-12 08:50 Olivier Utkala <diaspar@ifrance.com>
  0 siblings, 0 replies; 20+ messages in thread

From: Olivier Utkala @ 2000-01-12 08:50 UTC (permalink / raw)
  To: pgsql-interfaces

help
 
___________________________________________________________________________
Message envoye depuis iFrance :  http://www.ifrance.com ou 3615 IFRANCE
Gratuit : Hebergement (50 Mo)/Vos emails (POP,HTML,20 Mo, FAX)/Votre agenda




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

* Help
@ 2000-02-01 17:00 marc.travaille@free.fr
  0 siblings, 0 replies; 20+ messages in thread

From: marc.travaille@free.fr @ 2000-02-01 17:00 UTC (permalink / raw)
  To: pgsql-interfaces

Marc Travaillé
France

marc.travaille@free.fr

Create a data Base with PostgreSQL.

Psql createdb command need Postmaster started and to start postmaster, the data base must be specified.
How could I resolve the problem?

Thank you Marc.

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

* help
@ 2000-12-19 19:01 Joseph <joseph@sitewarehouse.net>
  0 siblings, 0 replies; 20+ messages in thread

From: Joseph @ 2000-12-19 19:01 UTC (permalink / raw)
  To: pgsql-general@postgresql.org; pgsql-admin@postgresql.org; pgsql-interfaces

Help me for "DBI->connect failed: Sorry, too many clients already."
my cgi program is test.cgi:
#######################
require "./connectdb.pl";
&connectdatabase();
$query="select count(*) from messages";
$sth=$dbh->prepare($query);
$sth->execute();
$count=$sth->fetchrow_array();
print "Content-type: text/html\n\n";
print <<"TAG";
<html>
<body>
<h2> The count is $count. </h2>
</body>
</html>
TAG
exit 0;
#############
my connectdb.pl :
sub connectdatabase {
#  my ($dbusername,$dbpassword)=@_;
  $dbusername="postgres";
  $dbpassword="lokicom";
  $dbname="mboardsony";
  use DBI;
  $dbh=DBI->connect("dbi:Pg:dbname=$dbname",$dbusername,$dbpassword) or die "can
not connect to $dbname\n";
}
1;
#######################
my os is Redhat 6.2,and perl 5.005,and  web server is Apache.
The problem is:when I run test.cgi,it can work properly.But when I press F5
to refresh the web page for sever minutes,the Apache will have error message:
"DBI->connect failed: Sorry, too many clients already."
  Who can help me?
  Thank you ahead.
  
  My email: joel_xue@hotmail.com

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

* Help
@ 2001-01-09 03:30 Gildasl@aol.com
  0 siblings, 0 replies; 20+ messages in thread

From: Gildasl@aol.com @ 2001-01-09 03:30 UTC (permalink / raw)
  To: pgsql-interfaces

which is the best way between python and postgresql
to build website with no xlm and so on.
just python and postgresql 
thanks
happy new year



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

* help
@ 2001-06-07 13:52 Ilan Fait <ilan@iweb.com>
  0 siblings, 0 replies; 20+ messages in thread

From: Ilan Fait @ 2001-06-07 13:52 UTC (permalink / raw)
  To: pgsql-interfaces



Hi,
I need help with finding some Documentation about how to install PostGerSQL
on windows 2000
Step by step since I am trying to install PostGerSQL DB on Win2000 O/S.

I have install the Cygwin but when I try create a database I get:

$ createdb iweb
psql: FATAL: PQsetdbLogin(): Unable to determine a Postgres username!
createdb: database creation failed

So I try to create a user I get:

$ createuser iweb
Shall the new user be allowed to create databases? (y/n) y
Shall the new user be allowed to create more new users? (y/n) y
psql: FATAL: PQsetdbLogin(): Unable to determine a Postgres username!
createuser: creation of user "iweb" failed

Can you please explain how do I need to install the database that it will
run on Win2000
Thanks,
Ilan

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

* help
@ 2003-07-31 08:55 sundaresan raman <netsun_r@yahoo.com>
  0 siblings, 0 replies; 20+ messages in thread

From: sundaresan raman @ 2003-07-31 08:55 UTC (permalink / raw)
  To: pgsql-interfaces

I am the new person of postgre sql.I was downloaded
postgre libpq c library.I need a clear document of
compilation process.Please help me.
 
thanks
sundar 

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



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

* help !!!
@ 2004-06-30 13:26 apellido jr., wilfredo p. <apellido@mactan.ph>
  0 siblings, 0 replies; 20+ messages in thread

From: apellido jr., wilfredo p. @ 2004-06-30 13:26 UTC (permalink / raw)
  To: pgsql-interfaces

Hello! im a newbie in C programing as well as Postgresql. The above example
is workin but im having difficulty regarding assigning the result of Query
Select.  here's the program

        int
        main()
        {
            char        UserName[50];                          /* holds user
state code */
            char        query_string[256];                      /* holds
constructed SQL query */
            PGconn     *conn;                                   /* holds
database connection */
            PGresult   *res;                                    /* holds
query result */

            conn = PQconnectdb("dbname=grade");                  /* connect
to the database */

            if (PQstatus(conn) == CONNECTION_BAD)               /* did the
connection fail? */
            {
                fprintf(stderr, "Connection to database failed.\n");
                fprintf(stderr, "%s", PQerrorMessage(conn));
                exit(1);
            }

            printf("Enter Username:  ");                    /* prompt user
for a state code */
            scanf("%s", UserName);

            sprintf(query_string,                               /* create an
SQL query string */
                    "SELECT username, value
                     FROM table1
                     where test = 'grade' and username = '%s'", UserName);

            res = PQexec(conn, query_string);                   /* send the
query */

            if (PQresultStatus(res) != PGRES_TUPLES_OK)         /* did the
query fail? */
            {
                fprintf(stderr, "SELECT query failed.\n");
                PQclear(res);
                PQfinish(conn);
                exit(1);
            }

            printf("\n\n\n");
            printf("Username :  %s\n\n\n", PQgetvalue(res, 0, 0));
            printf("Grade : %s  \n\n\n", PQgetvalue(res, 0, 1));

            PQclear(res);                                       /* free
result */

            PQfinish(conn);                                     /*
disconnect from the database */

            return 0;
        }

############################################################################
########


hello how can i assign to certain variable the output of PQgetvalue(res, 0,
1)? example i want to do like this ...

a = PQgetvalue(res, 0, 1)
printf("Grade : %s  \n\n\n", a );

and then after assigning the value of PQgetvalue(res, 0, 1) to a then ...

b = a \ 2;

but  it is possible to divide the output of "a" where it is a var and "b" is
integer?














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

* Re: help !!!
@ 2004-06-30 14:11 Goulet, Dick <DGoulet@vicr.com>
  2004-07-01 06:31 ` Re: help !!! Nigel J. Andrews <nandrews@investsystems.co.uk>
  0 siblings, 1 reply; 20+ messages in thread

From: Goulet, Dick @ 2004-06-30 14:11 UTC (permalink / raw)
  To: apellido jr., wilfredo p. <apellido@mactan.ph>; pgsql-interfaces

PGgetValue returns a character pointer, so if you have:

	char *reply_string = NULL;

	reply_string = PQgetResult(rex,0,0);
	

Dick Goulet
Senior Oracle DBA
Oracle Certified 8i DBA

-----Original Message-----
From: apellido jr., wilfredo p. [mailto:apellido@mactan.ph]
Sent: Wednesday, June 30, 2004 9:26 AM
To: pgsql-interfaces@postgresql.org
Subject: [INTERFACES] help !!!


Hello! im a newbie in C programing as well as Postgresql. The above example
is workin but im having difficulty regarding assigning the result of Query
Select.  here's the program

        int
        main()
        {
            char        UserName[50];                          /* holds user
state code */
            char        query_string[256];                      /* holds
constructed SQL query */
            PGconn     *conn;                                   /* holds
database connection */
            PGresult   *res;                                    /* holds
query result */

            conn = PQconnectdb("dbname=grade");                  /* connect
to the database */

            if (PQstatus(conn) == CONNECTION_BAD)               /* did the
connection fail? */
            {
                fprintf(stderr, "Connection to database failed.\n");
                fprintf(stderr, "%s", PQerrorMessage(conn));
                exit(1);
            }

            printf("Enter Username:  ");                    /* prompt user
for a state code */
            scanf("%s", UserName);

            sprintf(query_string,                               /* create an
SQL query string */
                    "SELECT username, value
                     FROM table1
                     where test = 'grade' and username = '%s'", UserName);

            res = PQexec(conn, query_string);                   /* send the
query */

            if (PQresultStatus(res) != PGRES_TUPLES_OK)         /* did the
query fail? */
            {
                fprintf(stderr, "SELECT query failed.\n");
                PQclear(res);
                PQfinish(conn);
                exit(1);
            }

            printf("\n\n\n");
            printf("Username :  %s\n\n\n", PQgetvalue(res, 0, 0));
            printf("Grade : %s  \n\n\n", PQgetvalue(res, 0, 1));

            PQclear(res);                                       /* free
result */

            PQfinish(conn);                                     /*
disconnect from the database */

            return 0;
        }

############################################################################
########


hello how can i assign to certain variable the output of PQgetvalue(res, 0,
1)? example i want to do like this ...

a = PQgetvalue(res, 0, 1)
printf("Grade : %s  \n\n\n", a );

and then after assigning the value of PQgetvalue(res, 0, 1) to a then ...

b = a \ 2;

but  it is possible to divide the output of "a" where it is a var and "b" is
integer?












---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



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

* Re: help !!!
  2004-06-30 14:11 Re: help !!! Goulet, Dick <DGoulet@vicr.com>
@ 2004-07-01 06:31 ` Nigel J. Andrews <nandrews@investsystems.co.uk>
  0 siblings, 0 replies; 20+ messages in thread

From: Nigel J. Andrews @ 2004-07-01 06:31 UTC (permalink / raw)
  To: Goulet, Dick <DGoulet@vicr.com>; +Cc: apellido jr., wilfredo p. <apellido@mactan.ph>; pgsql-interfaces


On Wed, 30 Jun 2004, Goulet, Dick wrote:
> PGgetValue returns a character pointer, so if you have:
> 
> 	char *reply_string = NULL;
> 
> 	reply_string = PQgetResult(rex,0,0);

Never used the C interface so I'll assume getValue is the function name...

> 
> hello how can i assign to certain variable the output of PQgetvalue(res, 0,
> 1)? example i want to do like this ...
> 
> a = PQgetvalue(res, 0, 1)
> printf("Grade : %s  \n\n\n", a );

That was answered above.

> 
> and then after assigning the value of PQgetvalue(res, 0, 1) to a then ...
> 
> b = a \ 2;
> 
> but  it is possible to divide the output of "a" where it is a var and "b" is
> integer?

Sure. The complexity depends how safety conscious you are.


double d;
char *s;

s = PQgetValue(...);

d = strtod(s,NULL) / 2.0;

will give zero or a perhaps unexpected result if s points to something that
isn't convertable to a double in it's entirety. Read up on strtod() but
basically, "abcde56.98" will give 0 and "56.98abcde" will give 56.98. You
supply a second argument to strtod, as below, to determine how successful the
conversion was.


char *end;

d = strtod(s,&end);
if (end != s+strlen(s))
{
	/* string incompletely converted */
}

or the above test could be replaced with if (*end) {... which is how I'd write
it.

Then there's also checks for under and overflow:

errno=0;
d=strtod(s,&end);
if (d == 0 && errno == ERANGE) { /* underflow */ }
if ((d == HUGE_VAL || d == -HUGE_VAL) && errno == ERANGE) { /* overflow */ }

I'm pretty sure that errno should not be set if there is no under or overflow
so those tests can be adjusted to take advantage of that fact.

Hope that helps. Remember, man pages are your friends and man -k can be a
useful starting point if you can think of a a keyword. Consider getting a book
on C, sorry can't recomend one, and/or searching the web for tutorials.


--
Nigel Andrews






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

* Re: help !!!
@ 2004-07-01 13:43 apellido jr., wilfredo p. <apellido@mactan.ph>
  0 siblings, 0 replies; 20+ messages in thread

From: apellido jr., wilfredo p. @ 2004-07-01 13:43 UTC (permalink / raw)
  To: Nigel J. Andrews <nandrews@investsystems.co.uk>; +Cc: pgsql-interfaces

 Hello Sir, thanks for reply.  Im just testing what you said and i got this
 error:

Enter Username:  apellido
 Username :  apellido
 Grade : (null)

-----------------------------
 my code:


double    i;
char       *reply_string;

reply_string = PQgetvalue(res, 0, 1);
  i = strtod(reply_string,NULL)/2.0;


Sir, i know that PQgetvalue(res, 0, 1); will return number although it is
 declare in the field varchar. Im already test

int i;                (also  tried unsigned short int)

reply_string = PQgetvalue(res, 0, 1);
 i = strtoul(reply_string,NULL, 3)/2.0;

Still i got the same error...  Im googling how to convert ascii to integer
 and i saw another question which confused me: here it is



Is there a command that can be used to temporarily convert a string value in
 a field to integer?

I.E.

SELECT name, employeeid
 FROM users
 WHERE employeeid = bob

In this case employeeid is an integer, and bob is a number but stored as a
 string.  how do you temporarily convert bob to an integer for the sake of
 the comparison?






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


end of thread, other threads:[~2004-07-01 13:43 UTC | newest]

Thread overview: 20+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-05-06 16:10 Help! Conrado Miguel Rodriguez Fernandez <conrado@Horus.aeronet.cu>
1998-06-23 14:55 HELP Maxim V. Kashin <max@adv.ru>
1998-06-30 19:28 help ALICE@TURING.UNICAMP.BR
1998-11-20 06:55 help Nicoleta TATARU <nicol@medanet.ro>
1998-12-18 08:33 help lijiandong <ljd@modern.org>
1999-04-12 13:39 help! StOo <stuart@comodo.net>
1999-04-12 17:37 ` Re: help! StOo <stuart@comodo.net>
1999-08-07 12:39 help Alexei Gumenchuk <lesha@test.kharkov.ua>
1999-08-26 18:03 Help shan <shan@channel21.com>
1999-12-22 20:29 help Utkala Olivier <o.utkala@hrnet.fr>
2000-01-12 08:50 help Olivier Utkala <diaspar@ifrance.com>
2000-02-01 17:00 Help marc.travaille@free.fr
2000-12-19 19:01 help Joseph <joseph@sitewarehouse.net>
2001-01-09 03:30 Help Gildasl@aol.com
2001-06-07 13:52 help Ilan Fait <ilan@iweb.com>
2003-07-31 08:55 help sundaresan raman <netsun_r@yahoo.com>
2004-06-30 13:26 help !!! apellido jr., wilfredo p. <apellido@mactan.ph>
2004-06-30 14:11 Re: help !!! Goulet, Dick <DGoulet@vicr.com>
2004-07-01 06:31 ` Re: help !!! Nigel J. Andrews <nandrews@investsystems.co.uk>
2004-07-01 13:43 Re: help !!! apellido jr., wilfredo p. <apellido@mactan.ph>

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