[PHP-DB] PostgreSQL Conference East: 2011 CFP

2011-01-31 Thread Joshua D. Drake
Following on the smashing success of PostgreSQL Conference West,
PostgreSQL Conference West, The PostgreSQL Conference for Developers,
End Users and Decision Makers, is being held at the Hotel Pennsylvania,
in New York City from March 22nd through 25th 2011. Please
join us in continuing to make this the largest PostgreSQL Conference 
series! 

Main site:
http://www.postgresqlconference.org/

CFP:
https://www.postgresqlconference.org/talk_types

Time line:
Dec 16th: Talk submission opens
Feb 10th: Talk submission closes
Feb 15th: Speaker notification

This year we will be continuing our trend of covering the entire
PostgreSQL ecosystem. We would like to see talks and tutorials on the
following topics:

  * General PostgreSQL: 
  * Administration 
  * Performance 
  * High Availability 
  * Migration 
  * GIS 
  * Integration 
  * Solutions and White Papers 
  * The Stack: 
  * Python/Django/Pylons/TurboGears/Custom 
  * Perl5/Catalyst/Bricolage 
  * Ruby/Rails 
  * Java (PLJava would be great)/Groovy/Grails 
  * Operating System optimization
(Linux/FBSD/Solaris/Windows) 
  * Solutions and White Papers 

-- 
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 509.416.6579
Consulting, Training, Support, Custom Development, Engineering
http://twitter.com/cmdpromptinc | http://identi.ca/commandprompt


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL query many escape characters?

2009-05-02 Thread John DeSoi


On May 1, 2009, at 3:59 PM, Carol Walter wrote:


It would be much easier to read and write like this:

$query = 'INSERT INTO "tblPeople"("fName","mName","lName", ivlweb,  
cnsweb)'
. " VALUES ($new_f_name_new, $new_m_name_new, $new_l_name_new,  
$new_ivl_web_peop, $new_cns_web_peop);";



First query: INSERT INTO "tblPeople"("fName","mName","lName",  
ivlweb, cnsweb) VALUES ('Frank', 'D', 'Oz', 't', 't');
Second query: INSERT INTO  
"tblContactInformation"("contactItem","contactType") VALUES ('f...@indiana.edu 
', '0010')

Can't execute 2nd query

Actually, neither query executes.



What is the exact error message you are seeing?




John DeSoi, Ph.D.





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL query many escape characters?

2009-05-01 Thread Carol Walter

Okay,

Here are the queries I've written.  I gave up on trying to make  
pg_query_params() work but this is what I have using pg_query().  I  
have been printing the query.  In fact, I can take the query as  
constructed, paste it into psql and it runs just fine.


I would be grateful for any help you can give.  This program will have  
three other queries which are more complex that this one.




/* Build variables by concatenating with single quotes.  */

   $new_f_name_new = "'" .  
$f_name_new . "'";

   $new_m_name_new = "'" . $m_name_new . "'";
   $new_l_name_new = "'" . $l_name_new . "'";
   $new_ivl_web_peop = "'" . $ivl_web_peop . 
"'";
   $new_cns_web_peop = "'" . $cns_web_peop . 
"'";
   $new_cont_rank = "'" . $cont_rank . "'";
   $new_cont_loc = "'" . $cont_loc . "'";
   $new_contact_info1 = "'" . $contact_info1 . 
"'";
   $new_contact_type = "'" . $contact_type . 
"'";

  /* Execute queries to insert record in people table, contact table,  
and people - contact bridge table.  */


   		   	$query = "INSERT INTO \"tblPeople\"(\"fName\",\"mName 
\",\"lName\", ivlweb, cnsweb)
 			 VALUES ($new_f_name_new,  
$new_m_name_new, $new_l_name_new, $new_ivl_web_peop,  
$new_cns_web_peop);";

echo "First query: " . $query . "";
$pg_peop_ins = pg_query($query);
echo pg_result_error($pg_peop_ins);

  	  		 $query = "INSERT INTO \"tblContactInformation 
\"(\"contactItem\",\"contactType\")
 		 	VALUES ($new_contact_info1,  
$new_contact_type)";

echo "Second query: " . $query . "";
  	   		$pg_contact_ins = pg_query($query) or die("Can't  
execute 2nd query");
  	   		$query = "INSERT INTO  
\"brdgPeopleContactInformation\" (\"peopleId\",\"contactInformationId 
\",rank, type)
  	 	VALUES  
(currval('\"tblPeople_peopleId_seq 
\"'),currval('\"tblContactInformation_contactInformationId_seq\"'),  
$new_cont_rank, $new_cont_loc)";

echo "Third query: " . $query . "";
  			$pg_peop_cont_ins = pg_query($query) or  
die("Can't execute 3rd query");


When I execute the code, the page has this...

First query: INSERT INTO "tblPeople"("fName","mName","lName", ivlweb,  
cnsweb) VALUES ('Frank', 'D', 'Oz', 't', 't');
Second query: INSERT INTO  
"tblContactInformation"("contactItem","contactType") VALUES ('f...@indiana.edu 
', '0010')

Can't execute 2nd query

Actually, neither query executes.

Thanks again.

Carol

On May 1, 2009, at 2:53 PM, danaketh wrote:


Hi,

  you should post the INSERT query too. I'd recommend you to print  
the query before running it. Just put echo $query; before/after  
pg_query(). You'll see what are you sending to the database. This  
may help you find the problem. Also using ` instead of " in query  
may help you to make it easier to read.



Carol Walter napsal(a):

Hello,

I am very new to this process, so please forgive me if this is a  
silly question.  I have a number of PostgreSQL tables that use the  
naming convention that capitalizes the first character of each  
word, therefor the data names require quotes.  When I put together  
my queries using parameters for the selected columns and the table  
names and use pg_query_params instead of pg_query to build the  
query?  Doing it without the parameterization looks like this...


$query = "SELECT tp.\"peopleId\",\"fName\",\"mName\",\"lName\", 
\"contactItem\"

FROM \"tblPeople\" tp
 LEFT JOIN \"brdgPeopleContactInformation\"  
bpci ON tp.\"peopleId\" = bpci.\"peopleId\"
 LEFT JOIN \"tblContactInformation\" tci ON  
bpci.\"contactInformationId\" =

 tci.\"contactInformationId\"
 WHERE (\"lName\" like '$l_name' AND \"fName\"  
IS NULL) OR (\"lName\" like '$l_name' AND \"fName\"

  LIKE '$f_name')
 ORDER BY \"lName\",\"fName\",\"mName\"";
   $SciName = pg_query($query);

This actually works, believe it or not, but my next query where I'm  
doing an insert to the tables does not.


Thank you in advance for your time.

Carol




--

S pozdravem

Daniel Tlach
Freelance webdeveloper

Email: m...@danaketh.com
ICQ: 160914875
MSN: danak...@hotmail.com
Jabber: danak...@jabbim.cz




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL query many escape characters?

2009-05-01 Thread danaketh

Hi,

   you should post the INSERT query too. I'd recommend you to print the 
query before running it. Just put echo $query; before/after pg_query(). 
You'll see what are you sending to the database. This may help you find 
the problem. Also using ` instead of " in query may help you to make it 
easier to read.



Carol Walter napsal(a):

Hello,

I am very new to this process, so please forgive me if this is a silly 
question.  I have a number of PostgreSQL tables that use the naming 
convention that capitalizes the first character of each word, therefor 
the data names require quotes.  When I put together my queries using 
parameters for the selected columns and the table names and use 
pg_query_params instead of pg_query to build the query?  Doing it 
without the parameterization looks like this...


$query = "SELECT 
tp.\"peopleId\",\"fName\",\"mName\",\"lName\",\"contactItem\"

 FROM \"tblPeople\" tp
  LEFT JOIN \"brdgPeopleContactInformation\" bpci 
ON tp.\"peopleId\" = bpci.\"peopleId\"
  LEFT JOIN \"tblContactInformation\" tci ON 
bpci.\"contactInformationId\" =

  tci.\"contactInformationId\"
  WHERE (\"lName\" like '$l_name' AND \"fName\" IS 
NULL) OR (\"lName\" like '$l_name' AND \"fName\"

   LIKE '$f_name')
  ORDER BY \"lName\",\"fName\",\"mName\"";
$SciName = pg_query($query);

This actually works, believe it or not, but my next query where I'm 
doing an insert to the tables does not.


Thank you in advance for your time.

Carol




--

S pozdravem

Daniel Tlach
Freelance webdeveloper

Email: m...@danaketh.com
ICQ: 160914875
MSN: danak...@hotmail.com
Jabber: danak...@jabbim.cz



[PHP-DB] PostgreSQL query many escape characters?

2009-05-01 Thread Carol Walter

Hello,

I am very new to this process, so please forgive me if this is a silly  
question.  I have a number of PostgreSQL tables that use the naming  
convention that capitalizes the first character of each word, therefor  
the data names require quotes.  When I put together my queries using  
parameters for the selected columns and the table names and use  
pg_query_params instead of pg_query to build the query?  Doing it  
without the parameterization looks like this...


$query = "SELECT tp.\"peopleId\",\"fName\",\"mName\",\"lName\", 
\"contactItem\"

FROM \"tblPeople\" tp
  		LEFT JOIN \"brdgPeopleContactInformation\" bpci ON tp. 
\"peopleId\" = bpci.\"peopleId\"
  		LEFT JOIN \"tblContactInformation\" tci ON bpci. 
\"contactInformationId\" =


tci.\"contactInformationId\"
  		WHERE (\"lName\" like '$l_name' AND \"fName\" IS  
NULL) OR (\"lName\" like '$l_name' AND \"fName\"

LIKE '$f_name')
ORDER BY \"lName\",\"fName\",\"mName\"";
$SciName = pg_query($query);

This actually works, believe it or not, but my next query where I'm  
doing an insert to the tables does not.


Thank you in advance for your time.

Carol


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL Conference, U.S. East 09 Call for Papers

2009-01-26 Thread Joshua D. Drake
PostgreSQL Conference, U.S., East 09 will be held in Philadelphia at
historic Drexel University from April 3rd through 5th. The call for
papers is now out at: http://www.postgresqlconference.org/2009/east/ .

As always we let our submissions define our actual tracks. If you have
something you want to talk about it. Submit it. As long as it is about
PostgreSQL (or doing something with PostgreSQL) we will consider it.

We are seeking creative ideas about things we can do at the conference.
At West we had a code sprint. The sprint was very successful as it was
about all things postgresql and open source. It wasn't just hacking back
end code but people worked on all kinds of things.. Is someone up for
running a code sprint? 

There has also been specific interest in having us add (in addition to
our advanced topics) a newbie track. Please do not be afraid to submit a
talks on items such as:

  * Backing up PostgreSQL
  * Understanding and Configuring Autovacuum
  * Normalization
  * Trigger Happy (how to use triggers ;)
  * PITR -- happiness is a shipped transaction log

Other topics we are interested in beyond the standard PostgreSQL
architectural fanfare are:

  * Groovy/Grails
  * Django
  * PHP
  * Postgis
  * Pylons
  * SQL Alchemy
 
So don't delay, PostgreSQL Conference, U.S. is the premeire PostgreSQL
conference series for the United States PostgreSQL community! Please
submit your talk here: http://www.postgresqlconference.org/2009/east/ .

Sincerely,

Joshua D. Drake
-- 
PostgreSQL - XMPP: jdr...@jabber.postgresql.org
   Consulting, Development, Support, Training
   503-667-4564 - http://www.commandprompt.com/
   The PostgreSQL Company, serving since 1997


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL pg_query_params, PHP locales, and double data types

2008-11-11 Thread Alec Smecher

Hi all,

I'm trying to get a PHP bug in the PostgreSQL pg_query_params function 
reopened; it's been marked bogus (incorrectly IMO). There are lots of 
details at . If this is in fact 
bogus, I'd appreciate a little bit of feedback.


Many thanks!
Alec Smecher
Public Knowledge Project Team

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] postgresql connection management

2008-02-28 Thread jim white

Chris wrote:

jim white wrote:
I am running several web sites on one server, each of which connects 
to a different Postgresql database. I use some include files to load 
functions and classes. If I put pg_connect at the start of the 
include file, then sometimes I do not connect to the correct database 
from functions in a class. If I run echo pg_dbname(); in these 
functions I see that I am connected to the wrong database. Here are 
some possible fixes:


The best solution is to work out why it's not connecting to the right 
db in the first place, don't do any workarounds.


When it's wrong, what db is it connecting to? Can you work out a pattern?

You don't have a pg_connect() in one file and in another file is 
another pg_connect() to a different database?


Do you have any pg_close() calls? When you call pg_query again it 
might be after the db connection has been closed and so it creates a 
new connection (to the wrong db).


I don't use pg_close(), I just let PHP close a connection when it 
unloads the page. Since I don't really understand why it is picking the 
connection to the wrong database, I have decided to be safe and rewrite 
all my queries with a named connection:


$result = pg_query($swdbcon, $query);

This is a little extra work, but better safe than sorry.


--
James (Jim) B. White
tel: (919)-380-9615
email: [EMAIL PROTECTED]
homepage: http://jimserver.net/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] postgresql connection management

2008-02-28 Thread Chris

jim white wrote:
I am running several web sites on one server, each of which connects to 
a different Postgresql database. I use some include files to load 
functions and classes. If I put pg_connect at the start of the include 
file, then sometimes I do not connect to the correct database from 
functions in a class. If I run echo pg_dbname(); in these functions I 
see that I am connected to the wrong database. Here are some possible 
fixes:


The best solution is to work out why it's not connecting to the right db 
in the first place, don't do any workarounds.


When it's wrong, what db is it connecting to? Can you work out a pattern?

You don't have a pg_connect() in one file and in another file is another 
pg_connect() to a different database?


Do you have any pg_close() calls? When you call pg_query again it might 
be after the db connection has been closed and so it creates a new 
connection (to the wrong db).


--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] postgresql connection management

2008-02-28 Thread jim white
I am running several web sites on one server, each of which connects to 
a different Postgresql database. I use some include files to load 
functions and classes. If I put pg_connect at the start of the include 
file, then sometimes I do not connect to the correct database from 
functions in a class. If I run echo pg_dbname(); in these functions I 
see that I am connected to the wrong database. Here are some possible 
fixes:


1:
$swdbcon = pg_connect("host=localhost dbname=swgap user=postgres"); //at 
start of file

global $swdbcon; // inside function
$result = pg_query($swdbcon, $query);

2:
if (pg_dbname() != "swgap") { //inside function
  pg_connect("host=localhost dbname=swgap user=postgres");
}

3:
pg_connect("host=localhost dbname=swgap user=postgres"); inside function

I have already written code that does not explicitly set the connection 
in each function and it worked fine. However, I find the problem 
occasionally  as I change the code. What is  the best  way  to get the  
proper connection inside functions?


Jim

--
James (Jim) B. White

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL Conference East: Call for Papers

2008-01-07 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

PostgreSQL Conference East is being held on the weekend of March 29th
and 30th, 2008 in College Park, Maryland. The conference will have a
series of talks, mini-tutorials and tutorials and we are now accepting
submissions!

If you are a third pary vendor, PostgreSQL developer, PostgreSQL
consultant, DBA, or just a user who really does cool stuff, you need to
submit a talk, or tutorial.

Do you know how to get that last 20 transactions per second out of an
array using adaptive readahead? Maybe you know more about Autovacuum
than you ever care to admit? Perhaps, you have recently deployed
PostgreSQL and saved a company 300k over the next closest competitor...

Now is your time to share, learn and participate in the community!
Submit your talk at:

http://www.postgresqlconference.org/talk_submission/ .

PostgreSQL Conference East is part of the PostgreSQL Community
Conference series. All proceeds from the conferences are donations to
PostgreSQL via the non-profit Software in the Public Interest a U.S.
501c3. 

- -- 
The PostgreSQL Company: Since 1997, http://www.commandprompt.com/ 
Sales/Support: +1.503.667.4564   24x7/Emergency: +1.800.492.2240
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
SELECT 'Training', 'Consulting' FROM vendor WHERE name = 'CMD'


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHgnlCATb/zqfZUUQRAqc1AKCaKdHsOOU7YntQNDCO0l7/PE0tfQCgi970
F0Z7Il0anhOXRB1+I2FD24I=
=Ql8O
-END PGP SIGNATURE-


[PHP-DB] PostgreSQL pg_connection_status() bug?

2007-12-07 Thread Scott
I found some quite odd today and I am wondering if anyone else has 
encountered this (or can reproduce it) - or maybe I am just going crazy.


The function pg_connection_status() should return PGSQL_CONNECTION_BAD or 
null if the PostgreSQL service/database has stopped/restarted/ is not 
responding - after you have connected to it.


But what I encountered today suggests that is continues to return 
PGSQL_CONNECTION_OK after the stop / restart.  It will only start returning 
PGSQL_CONNECTION_BAD if you try to run a query.


For example - this is what I am experiencing:

$link_id = pg_connect("dbname=test");

//do some queries ... etc ...

// pg_connection_status($link_id) equals PGSQL_CONNECTION_OK;

*** PostgreSQL database/service is stopped or restarted ***

// pg_connection_status($link_id) still equals PGSQL_CONNECTION_OK;

pg_query($link_id,$query); // this fails - outputs an error

// pg_connection_status($link_id) now equals PGSQL_CONNECTION_BAD or null;

Any comments or suggestions would be appreciated.  Thanks.

Scott

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] postgresql, pg_pconnect issues, how to close connection properly

2006-09-08 Thread Ferencz-Csibi Attila

2006/9/8, Julian Tree <[EMAIL PROTECTED]>:

I have a pretty complex data base that runs a lot of aggreated
function (sum, count in addtion to joins)  constantly.  If I turn off
pg_pconnect, the connection takes too long, if I turn on the
pg_pconnect, the connection eventually max out.

My current solution is to have cron job to restart apache gracefull
every minute.

> apachectl graceful

I don't like this solution.  Is there a way to reset the connections
every so often?


Hi

You're running out off memory? Read after about optimization of
postgresql server settings But probably that won't be enough.

You should realy look after those queries too. Why are they takeing so
much of resources? I bet that you can optimize them. Expand your
hardware (maybe some more memory will do the job?)

You can optimize your code. As a workaround you can use 2 different
connections. One for the complex sql queries and one for relative
simple ones. Monitoring the load distributionshould also help.

So you realy, realy have the job to do :)

A.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] postgresql, pg_pconnect issues, how to close connection properly

2006-09-08 Thread Julian Tree

I have a pretty complex data base that runs a lot of aggreated
function (sum, count in addtion to joins)  constantly.  If I turn off
pg_pconnect, the connection takes too long, if I turn on the
pg_pconnect, the connection eventually max out.

My current solution is to have cron job to restart apache gracefull
every minute.


apachectl graceful


I don't like this solution.  Is there a way to reset the connections
every so often?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL function call model for PHP

2006-05-17 Thread John DeSoi

A short article on using a class to call PostgreSQL functions:

http://pgedit.com/resource/php/pgfuncall

Comments and suggestions welcome!


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL functions missing

2006-04-27 Thread Tony Grimes
Hi Chris,

I'm not sure if PG was updated at the same time. I do know that a separate
server has no problem connecting to the database and it's running PHP 4.3.
In any case, I think I've given the support guys enough info to go on.

I figure if they broke it, they can fix it :)

Thanks,
Tony


On 4/26/06 8:55 PM, "chris smith" <[EMAIL PROTECTED]> wrote:

> On 4/27/06, Tony Grimes <[EMAIL PROTECTED]> wrote:
>> Hi,
>> 
>> My sys admin installed an update to H-Sphere (control panel software) that
>> broke PEAR::DB and phpBB last week. After much trial and error, I finally
>> tracked it down to missing pg_affected_rows() and pg_cmdtuples() functions
>> (for PEAR and phpBB respectively) in PHP. I'm assuming that the H-Sphere
>> update also included an upgrade for PHP and they didn't compile it right.
>> 
>> Does anyone know how we can fix this? Does Psoft (the company that makes
>> H-Sphere) have to recompile libpq? The server is currently running PHP 4.4.2
>> and PosgreSQL 7.4.11. Any insight would be much appreciated.
> 
> Was postgres updated at the same time or possibly compiled against a
> different version to yours?
> 
> http://www.php.net/manual/en/ref.pgsql.php
> 
> Note:  Not all functions are supported by all builds. It depends on
> your libpq (The PostgreSQL C client library) version and how libpq is
> compiled. If PHP PostgreSQL extensions are missing, then it is because
> your libpq version does not support them.
> 
> I guess psoft needs to help you sort this one out..
> 
> --
> Postgresql & php tutorials
> http://www.designmagick.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL functions missing

2006-04-26 Thread chris smith
On 4/27/06, Tony Grimes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> My sys admin installed an update to H-Sphere (control panel software) that
> broke PEAR::DB and phpBB last week. After much trial and error, I finally
> tracked it down to missing pg_affected_rows() and pg_cmdtuples() functions
> (for PEAR and phpBB respectively) in PHP. I'm assuming that the H-Sphere
> update also included an upgrade for PHP and they didn't compile it right.
>
> Does anyone know how we can fix this? Does Psoft (the company that makes
> H-Sphere) have to recompile libpq? The server is currently running PHP 4.4.2
> and PosgreSQL 7.4.11. Any insight would be much appreciated.

Was postgres updated at the same time or possibly compiled against a
different version to yours?

http://www.php.net/manual/en/ref.pgsql.php

Note:  Not all functions are supported by all builds. It depends on
your libpq (The PostgreSQL C client library) version and how libpq is
compiled. If PHP PostgreSQL extensions are missing, then it is because
your libpq version does not support them.

I guess psoft needs to help you sort this one out..

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL functions missing

2006-04-26 Thread Tony Grimes
Hi,

My sys admin installed an update to H-Sphere (control panel software) that
broke PEAR::DB and phpBB last week. After much trial and error, I finally
tracked it down to missing pg_affected_rows() and pg_cmdtuples() functions
(for PEAR and phpBB respectively) in PHP. I'm assuming that the H-Sphere
update also included an upgrade for PHP and they didn't compile it right.

Does anyone know how we can fix this? Does Psoft (the company that makes
H-Sphere) have to recompile libpq? The server is currently running PHP 4.4.2
and PosgreSQL 7.4.11. Any insight would be much appreciated.

Thanks in advance,
Tony

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Luis Morales
Hi,

I write an litle procedure about migration from postgres 7x to 8x. 

this is the link:
http://fastonion.blogspot.com/2005/04/gentoo-migrando-postgres-7x-8.html

In Resume you must be do:

On current DB Server:
su - postgres
pg_dumpall > /tmp/db.out


On remote DB Server:
copy db.out to new location on new server
su - postgres 
psql -f db.out template1

Good Luck! 

Regards,

Luis Morales

On Mon, 2005-06-27 at 15:46 -0300, Martín Marqués wrote:
> El Lun 27 Jun 2005 15:31, Mark Galbreath escribió:
> > I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
> > 5.0.4 
> with PostgreSQL 8.0.3.
> > 
> > Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
> mode on port 8181) running concurrently on my DEV box.  I installed 
> PostgreSQL 8.0.3 on the DEV box as well.
> > 
> > On the PostgreSQL 7.2 server, I did a pg_dumpall > db.out and ftp'd db.out 
> to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, 
> the PostgreSQL archiver aborts with the error: "input file does not appear to 
> be a valid archive"
> 
> Never used pg_restore. I just do this:
> 
> $ psql -f db.out
> 
> Always worked for me.
> 
> -- 
> select 'mmarques' || '@' || 'unl.edu.ar' AS email;
> -
> Martín Marqués  |   Programador, DBA
> Centro de Telemática  | Administrador
>Universidad Nacional
> del Litoral
> -
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Martín Marqués
El Lun 27 Jun 2005 15:31, Mark Galbreath escribió:
> I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 5.0.4 
with PostgreSQL 8.0.3.
> 
> Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
mode on port 8181) running concurrently on my DEV box.  I installed 
PostgreSQL 8.0.3 on the DEV box as well.
> 
> On the PostgreSQL 7.2 server, I did a pg_dumpall > db.out and ftp'd db.out 
to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, 
the PostgreSQL archiver aborts with the error: "input file does not appear to 
be a valid archive"

Never used pg_restore. I just do this:

$ psql -f db.out

Always worked for me.

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-
Martín Marqués  |   Programador, DBA
Centro de Telemática| Administrador
   Universidad Nacional
del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Martín Marqués
El Lun 27 Jun 2005 17:48, Mark Galbreath escribió:
> The solution was to make sure that ftp mode is in ASCII (type I) and then 
execute the following, assuming a dummy database, "test," has been created as 
part of the installation, and the database dump resides 
at /usr/local/pgsql/temp:

The best thing, giving the case that he's using Linux, is to use scp.

-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-
Martín Marqués  |   Programador, DBA
Centro de Telemática| Administrador
   Universidad Nacional
del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Mark Galbreath
The solution was to make sure that ftp mode is in ASCII (type I) and then 
execute the following, assuming a dummy database, "test," has been created as 
part of the installation, and the database dump resides at 
/usr/local/pgsql/temp:

On 7.2 server:
$ /usr/local/pgsql/bin/pg_dumpall --format=ASCII > db.out

On 8.0.3 server:

$ ftp [IP address]
$ ftp>cd [db.out location]
$ ftp>lcd /usr/local/pgsql/temp
$ ftp>ascii
$ ftp>get db.out
$ ftp>bye

$ /usr/local/pgsql/bin/psql test

# \i /usr/local/pgsql/temp/db.out
[database]-# \q
$

-
That's it.  This was by no means obvious from the documentation, by the way.

But now the real fun begins...will the migration work?  Stay tuned

~mark

-Original Message-
From: D.C. [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 4:23 PM

Le 27 juin 05, à 21:23, Mark Galbreath a écrit :

> Thanks for your reply, Des; unfortunately, your suggestion had no 
> affect.  I realize this is technically a PostgreSQL issue, but 
> rationalized my request help here because (1) this is the PHP-DB list 
> and PHP is used with MySQL and PostgreSQL more than any other 
> databases, and (2) I assumed that since PHP5 and PostgreSQL 8.0 have 
> been released, there are many developers who have had to deal with 
> this or a similar problem.

Hey, no worries.  I wasn't actually 'flaming' you for posting your 
question here, as I've been subscribed all of two hours myself .. .but 
I did have exactly the same problem with pg_dump as you.  Google for my 
name and pg_dump, and it might turn up.  Regards ...

D.

--  
Des Coughlan
[EMAIL PROTECTED]





***
This email and any file transmitted with it may be confidential and is intended 
solely for the use of the individual or entity to whom it is addressed.  If you 
received this email in error please notify the DBM Service Desk by forwarding 
this message to [EMAIL PROTECTED]


This email has been scanned by networkMaryland Antivirus Service for the 
presence of computer viruses.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread D . C .

Le 27 juin 05, à 21:23, Mark Galbreath a écrit :

Thanks for your reply, Des; unfortunately, your suggestion had no 
affect.  I realize this is technically a PostgreSQL issue, but 
rationalized my request help here because (1) this is the PHP-DB list 
and PHP is used with MySQL and PostgreSQL more than any other 
databases, and (2) I assumed that since PHP5 and PostgreSQL 8.0 have 
been released, there are many developers who have had to deal with 
this or a similar problem.


Hey, no worries.  I wasn't actually 'flaming' you for posting your 
question here, as I've been subscribed all of two hours myself .. .but 
I did have exactly the same problem with pg_dump as you.  Google for my 
name and pg_dump, and it might turn up.  Regards ...


D.

--  
Des Coughlan

[EMAIL PROTECTED]






___
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Mark Galbreath
Thanks for your reply, Des; unfortunately, your suggestion had no affect.  I 
realize this is technically a PostgreSQL issue, but rationalized my request 
help here because (1) this is the PHP-DB list and PHP is used with MySQL and 
PostgreSQL more than any other databases, and (2) I assumed that since PHP5 and 
PostgreSQL 8.0 have been released, there are many developers who have had to 
deal with this or a similar problem.

~mark

-Original Message-
From: D.C. [mailto:[EMAIL PROTECTED]
Sent: Monday, June 27, 2005 2:43 PM

Le 27 juin 05, à 20:31, Mark Galbreath a écrit :

> I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
> 5.0.4 with PostgreSQL 8.0.3.
>
> Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 
> (default CGI mode on port 8181) running concurrently on my DEV box.  I 
> installed PostgreSQL 8.0.3 on the DEV box as well.
>
> On the PostgreSQL 7.2 server, I did a pg_dumpall > db.out and ftp'd 
> db.out to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to 
> pg_restore db.out, the PostgreSQL archiver aborts with the error: 
> "input file does not appear to be a valid archive"
>
> I'd sure appreciate a clue on this issue!

Try -format .. and output it as ASCII ... I _seem_ to recall having a 
similar issue a month or so ago .. this is really a PostgreSQL issue, 
though.






This email and any file transmitted with it may be confidential and is intended 
solely for the use of the individual or entity to whom it is addressed.  If you 
received this email in error please notify the DBM Service Desk by forwarding 
this message to [EMAIL PROTECTED]


This email has been scanned by networkMaryland Antivirus Service for the 
presence of computer viruses.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread D . C .

Le 27 juin 05, à 20:31, Mark Galbreath a écrit :

I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 
5.0.4 with PostgreSQL 8.0.3.


Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 
(default CGI mode on port 8181) running concurrently on my DEV box.  I 
installed PostgreSQL 8.0.3 on the DEV box as well.


On the PostgreSQL 7.2 server, I did a pg_dumpall > db.out and ftp'd 
db.out to the PostgreSQL 8.0.3 (DEV) server.  When I attempt to 
pg_restore db.out, the PostgreSQL archiver aborts with the error: 
"input file does not appear to be a valid archive"


I'd sure appreciate a clue on this issue!


Try -format .. and output it as ASCII ... I _seem_ to recall having a 
similar issue a month or so ago .. this is really a PostgreSQL issue, 
though.


D.`

--  
Des Coughlan

[EMAIL PROTECTED]






___
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez cette version sur http://fr.messenger.yahoo.com


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL 7.2 - 8.0 replication issue

2005-06-27 Thread Mark Galbreath
I have to upgrade a web app from PHP 4.3.11 with PostgreSQL 7.2 to PHP 5.0.4 
with PostgreSQL 8.0.3.

Currently I have PHP4 (as Apache 2.54 mod on port 80) and PHP5 (default CGI 
mode on port 8181) running concurrently on my DEV box.  I installed PostgreSQL 
8.0.3 on the DEV box as well.

On the PostgreSQL 7.2 server, I did a pg_dumpall > db.out and ftp'd db.out to 
the PostgreSQL 8.0.3 (DEV) server.  When I attempt to pg_restore db.out, the 
PostgreSQL archiver aborts with the error: "input file does not appear to be a 
valid archive"

I'd sure appreciate a clue on this issue!

tia,
~mark





***
This email and any file transmitted with it may be confidential and is intended 
solely for the use of the individual or entity to whom it is addressed.  If you 
received this email in error please notify the DBM Service Desk by forwarding 
this message to [EMAIL PROTECTED]


This email has been scanned by networkMaryland Antivirus Service for the 
presence of computer viruses.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL with php error

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   Login

   
   
   
   
   

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user "auth" in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   Login

   
   
   
   
   

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user "auth" in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL error with PHP

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   Login

   
   
   
   
   

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user "auth" in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL error with php

2005-06-26 Thread Thomas Bonham

Hello All,
I’m trying to get php to connect to my PostgreSQL database.
The code that I’m using is below.


   Login

   
   
   
   
   

Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: 
IDENT authentication failed for user "auth" in 
/var/www/html/thomas/cis166ae/database/secretdb.php on line 8


Below is how I set up my database.

[EMAIL PROTECTED] # Su – postgres

-bash-3.00$ createuser –D –A –E
auth
-bash-3.00$ createdb auth

Thanks Helping

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] postgresql and php

2005-04-24 Thread Robby Russell
On Sat, 2005-04-23 at 20:31 -0500, Tate wrote:
> I have php and postgresql installed on my laptop with linux fedora core 
> 3.  Everything is working fine, but I have created a survey and want the 
> entries automatically inserted into the database.
> 
> I know what my SQL should be, but I'm not sure if my other coding is 
> correct.
> 
> In my form, I have radio buttons.
> 
> Any and all help is appreciated.
> 

Might you consider showing us some code and/or trying it out yourself
and coming to us when you hit a problem?

-Robby

-- 
/**
* Robby Russell, Owner.Developer.Geek
* PLANET ARGON, Open Source Solutions & Web Hosting
* Portland, Oregon | p: 503.351.4730 | f: 815.642.4068
* www.planetargon.com | www.robbyonrails.com
***/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] postgresql and php

2005-04-23 Thread Tate
I have php and postgresql installed on my laptop with linux fedora core 
3.  Everything is working fine, but I have created a survey and want the 
entries automatically inserted into the database.

I know what my SQL should be, but I'm not sure if my other coding is 
correct.

In my form, I have radio buttons.
Any and all help is appreciated.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Postgresql Performance

2004-08-19 Thread Matt M.
On Thu, 19 Aug 2004 18:12:16 -0500, Norma Ramirez
<[EMAIL PROTECTED]> wrote:
> Hi all, I have a problem with a small software in Postresql, through the
> time the database become slower and slower so, quick solution: pg_dump,
> dropdb, createdb and pg_dump again but this software is becoming important
> and such procedure is not a very reliable way to improve the performance, I
> have tried with some commands like Vacuum and Analyze but non of this seems
> to work as good as drop database and create again.
> 
> Can any one give me some advices?

1. vacuum and analyze would be my suggestions but you say you have tried that.
2. maybe upgrade your postgres version
3. try a postgres mailing list

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Postgresql Performance

2004-08-19 Thread Norma Ramirez
Hi all, I have a problem with a small software in Postresql, through the
time the database become slower and slower so, quick solution: pg_dump,
dropdb, createdb and pg_dump again but this software is becoming important
and such procedure is not a very reliable way to improve the performance, I
have tried with some commands like Vacuum and Analyze but non of this seems
to work as good as drop database and create again.

Can any one give me some advices?

Thanks

Norma R

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] postgresql field size information

2004-05-27 Thread Cornelia Boenigk
Hi

Try

select  attname, format_type(atttypid, atttypmod),
col_description(attrelid, attnum) from pg_attribute, pg_class c where
c.oid = attrelid
and attnum > 0 and c.relname = 'tablename' ;

Regards
Conni
--
Datenbanklösungen + PostgreSQL + Webdesign
http://www.cornelia-boenigk.de | http://www.pgsql.info
http://www.dpunkt.de/buch/3-89864-175-9.html

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] postgresql field size information

2004-05-27 Thread Scot L. Harris
I need to get the size of the fields defined in a postgresql table for
use in my PHP script.

For instance:

$fieldname = pg_field_name($stat,$i);
$size = pg_field_size($stat,$i);
$type = pg_field_type($stat,$i);

I tried using pg_field_size but for char type fields it returns a -1
indicating the field is variable length.  I need to get the defined size
of the field.  

pg_field_prtlen does not appear to be the correct function to return
this type of information.

I did get most of what I needed from this query:

$stat = pg_query($dbh,"select attname,atttypmod from pg_class c join
pg_attribute a on c.oid = a.attrelid where c.relname = '$tablename' and
a.attnum >= 0");

But the atttypmod field appears to have some overhead included (4
bytes).  I can adjust for that but there must be an easier way to get
the information for a field defined in a table.

Suggestions on how to do this?

-- 
Scot L. Harris <[EMAIL PROTECTED]>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL lib and character case

2004-04-28 Thread Martin Marques
El Wednesday 28 April 2004 03:21, Tumurbaatar S. escribió:
> I use pg_fetch_array() to get a record content. But it seems that
> to access elements of  the returned associative array, I should
> use lowercase field names. Is there any way to use case-insensitive
> field names?

No. PHP is case-sensitive, so you have to use lower case (unless you made the 
relation name case-sensitive when you created the PG table).

-- 
 19:21:02 up 43 min,  6 users,  load average: 1.46, 0.73, 0.58
-
Martín Marqués| select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
  del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL lib and character case

2004-04-28 Thread Doug Thompson
Tumurbaatar S. wrote:
I use pg_fetch_array() to get a record content. But it seems that
to access elements of  the returned associative array, I should
use lowercase field names. Is there any way to use case-insensitive
field names?
Assuming you want all lower case, convert the form field entry using strtolower().

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] PostgreSQL lib and character case

2004-04-27 Thread Tumurbaatar S.
I use pg_fetch_array() to get a record content. But it seems that
to access elements of  the returned associative array, I should
use lowercase field names. Is there any way to use case-insensitive
field names?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL + Cygwin

2004-04-16 Thread Gabriel Gramajo
Alguien ha hecho funcionar PostgreSQL con Cygwin, que error puede ser que me diga que 
gcc no puede generar ejecutables.


Gracias desde ya,

Saludos,

Gabriel.

[PHP-DB] postgresql

2004-04-14 Thread Adam Williams
Hi, I know this isn't PHP related but I have a quick question about 
postgresql.  I come from a mysql enviroment so I'm a little clueless, even 
after reading the postgresql docs.  

I am moving a postgresql database from one server to another.  As the user 
that owns the database, lculber, I ran pg_dump sroom1 > sroom1.database 
but on the server I'm moving the database to, I can't figure out how to 
get into psql to create the user lculber so I can do psql sroom1 < 
sroom1.database

so how can I create the users lculber in postgresql.  I can't even connect 
to psql.  any advice? :)  below is my command.  I'm not trying to database 
root, I just want to get the psql prompt so I can create the user lculber.

[EMAIL PROTECTED] root]# psql -U root
psql: FATAL:  Database "root" does not exist in the system catalog.
[EMAIL PROTECTED] root]# createuser lculber
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:  user "root" does not exist
createuser: creation of user "lculber" failed

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] PostgreSQL on Windows

2003-12-09 Thread Mike U. Petrov
I think yes.
For more information see
http://techdocs.postgresql.org/guides/InstallingOnWindows

Mike U. Petrov


-Original Message-
From: Rosen [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 09, 2003 6:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PostgreSQL on Windows


Hi,
Can I start PostgreSQL server and client on Windows machine ?

Thanks in advance!
Rosen

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL on Windows

2003-12-09 Thread Rosen
Hi,
Can I start PostgreSQL server and client on Windows machine ?

Thanks in advance!
Rosen

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] postgresql and unicode

2003-12-04 Thread Didier Bretin
Hi,

I would like to connect to a postgres server which is configured in unicode
with php. In java, when I do the connexion, I specify the charset at the
connexion. Apparently I have no option in pg_connect() function to specify
this.
How can I do this ? By the pg_set_client_encoding() function ?

Regards.
--
   ..
   .^. | Didier Bretin, France | [EMAIL PROTECTED]|
   /V\ |---| www.informactis.com|
  // \\|   `|
 /(   )\   | Visit: http://www.vim.org/ |
  ^^-^^`'
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] PostgreSQL

2003-11-24 Thread Gerard Samuel
On Monday 24 November 2003 10:58 am, David Kendal wrote:
> Hello! I'm new to to Postgre so excuse me, but is Postgre the same as
> MySQL?

Yes and No.

Both are databases.  Both can be interfaced to php.

But

Under the hoods of both, are very different.

For more information, 
http://www.mysql.com/
http://www.postgresql.org/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL

2003-11-24 Thread David Kendal
Hello! I'm new to to Postgre so excuse me, but is Postgre the same as MySQL?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL, Triggers

2003-10-20 Thread Ling
Thank you Martin!!!
you've just saved my life!

; )

Regards
Ling.

"Martin Marques" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
El Dom 19 Oct 2003 13:54, Ling escribió:
> Hello there.
> Can anybody help me with Postgresql triggers?
> what I need is a trigger which inrements value in field "total_rows.rows"
> if I insert new row in table "zzz"...
>
> CAREATE TABLE zzz (
> ...
> ...
> );
> CREATE TABLE total_rows (
> table_name VARCHAR(32),
> total_rows BIGINT,
> CONSTRAINT pk_total_rows PRIMARY KEY(table_name, total_rows)
> );

A rule would be much easier:

CREATE RULE rule_name AS ON INSERT TO zzz DO
;


--
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telemática
   Universidad Nacional
del Litoral
-

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] PostgreSQL, Triggers

2003-10-19 Thread Martin Marques
El Dom 19 Oct 2003 13:54, Ling escribió:
> Hello there.
> Can anybody help me with Postgresql triggers?
> what I need is a trigger which inrements value in field "total_rows.rows"
> if I insert new row in table "zzz"...
>
> CAREATE TABLE zzz (
> ...
> ...
> );
> CREATE TABLE total_rows (
> table_name VARCHAR(32),
> total_rows BIGINT,
> CONSTRAINT pk_total_rows PRIMARY KEY(table_name, total_rows)
> );

A rule would be much easier:

CREATE RULE rule_name AS ON INSERT TO zzz DO 
;


-- 
select 'mmarques' || '@' || 'unl.edu.ar' AS email;
-
Martín Marqués  |[EMAIL PROTECTED]
Programador, Administrador, DBA |   Centro de Telemática
   Universidad Nacional
del Litoral
-

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL, Triggers

2003-10-19 Thread Ling
Hello there.
Can anybody help me with Postgresql triggers?
what I need is a trigger which inrements value in field "total_rows.rows"
if I insert new row in table "zzz"...

CAREATE TABLE zzz (
...
...
);
CREATE TABLE total_rows (
table_name VARCHAR(32),
total_rows BIGINT,
CONSTRAINT pk_total_rows PRIMARY KEY(table_name, total_rows)
);

Thanks a lots
regars
Ling.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] PostgreSQL connection

2003-08-14 Thread Joe Nilson Zegarra Galvez
Hi all, i have a question, i have a php file with all my class to
connect into a postgresql db and i'm using the pg_connect in this form:

pg_connect("192.168.1.100","","","",$dbase);

but when i have 8 or 10 users inserting data the db response is very
slow, is problem in the pg_connect?, all ppl use the same file_class.php
to connect to the db.

The SErver is a Compaq Proliant with two Xeon 2.20Ghz Processors, 1Gb
Memory, 20Gb SCSI HD, 1Gb Ethernet and Redhat Linux with apache 2.0.47,
php 4.2.2 and PostgreSQL 7.2.2

Thankx for your answers

Regards


Nilson


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] postgresql primarykeys foreignkeys tablenames screenfieldlength

2003-01-20 Thread Kevin Gordon
Any suggestions or improvements to the following code would be much
appreciated. Please send me an email:

function kgtables () 
{
if ($this->connection) 
{
$tablelist = "";
$sql = "SELECT " . 
"ic.relname " .
"FROM " .
"pg_class ic " .
"WHERE " .
"ic.relname not like 'pg%' " .
"AND ic.relname not like '%pk' " .
"AND ic.relname not like '%idx' ";
$tablelist = pg_query ($this->connection, $sql);
$this->num_tables = pg_num_rows($tablelist);
for ($i=0; $i < $this->num_tables; $i++) 
{
$r = pg_fetch_row($tablelist);
$obj->{$i + 1} = $r[0];
}
pg_free_result ($tablelist);
return $obj;
}
else 
{
echo 'Error: failed to name the tables ';
return 0;
}
}

function kgprimarykeys ($tablename = "") 
{
if ( $this->connection && $tablename != "" ) 
{
$keylist = "";
$sql = "SELECT " . 
"ic.relname AS index_name, " .
"bc.relname AS tab_name, " . 
"ta.attname AS column_name, " .
"i.indisunique AS unique_key, " .
"i.indisprimary AS primary_key " .
"FROM " .
"pg_class bc, " .
"pg_class ic, " .
"pg_index i, " .
"pg_attribute ta, " .
"pg_attribute ia " .
"WHERE " .
"bc.oid = i.indrelid " .
"AND ic.oid = i.indexrelid " .
"AND ia.attrelid = i.indexrelid " .
"AND ta.attrelid = bc.oid " .
"AND bc.relname = '" . $tablename . "' 
" .
"AND ta.attrelid = i.indrelid " .
"AND ta.attnum = i.indkey[ia.attnum-1] 
" .
"ORDER BY " .
"index_name, tab_name, column_name";
$keylist = pg_query ($this->connection, $sql);
$this->num_primarykeys = pg_num_rows($keylist);
$j = 1;
for ($i=0; $i < $this->num_primarykeys; $i++) 
{
$r = pg_fetch_row($keylist);
//  echo "Primary Key: $r[0], $r[1], $r[2], $r[3], $r[4], 
";
if ( $r[4] == TRUE)
{
$obj->{$j} = $r[2];
$j++;
}
}
pg_free_result ($keylist);
return $obj;
}
else 
{
echo 'Error: failed to name the primary keys in ' . $tablename 
. '';
return 0;
}
}

function kgforeignkeys ($tablename = "" ) 
{
if ( $this->connection && $tablename != "" ) 
{
$keylist = "";
$sql = "SELECT conname,
  pg_catalog.pg_get_constraintdef(oid) as condef 
FROM pg_catalog.pg_constraint r
WHERE r.conrelid = (SELECT c.oid
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace 
n 
   

RE: [PHP-DB] postgresql vs mysql

2002-12-28 Thread Boaz Yahav
If we want to go to back to the real world, lets check the results at
where most of the world does

http://www.tpc.org/tpcc/results/tpcc_perf_results.asp

However if $$$ is an issue, don't bother pressing the link :)

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, December 28, 2002 2:48 AM
To: 'Yasuo Ohgaki'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] postgresql vs mysql


> This benchmark do not help much in real life, if one care database 
> performance.

Did you even read the article? They used a real-world bookstore
application called Nile written in JSP and tested it with 50 to 1,000
concurrent users.
 
> Database performance will vary a lot with
configuration/schema/query/etc.
> It's very easy to make one is better while another is not.

Yes, that's why they fine tuned each one. They also invited each company
to send representatives to help them tune it. Only MySQL and Sybase did
so, IMB offered suggestions over email and apparently Oracle and
Microsoft couldn't be bothered. 

> I suggest to take benchmark by yourself with schema and query that is 
> similar to production system. (Don't forget to test with large
enough
> data)

Yes, perhaps you can loan me the money to get Oracle and MSSQL licenses
so I can test them out?

I understand what you're saying, every application is different. Yes, I
agree, but for those that can't afford to do extensive benchmarking like
this, we have to use these results and assume ours will be the same. 

What's this got to do with PHP? Nada... Happy New Year!

---John Holmes...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] postgresql vs mysql

2002-12-27 Thread Yasuo Ohgaki
John W. Holmes wrote:

This benchmark do not help much in real life, if one care database
performance.



Did you even read the article? They used a real-world bookstore
application called Nile written in JSP and tested it with 50 to 1,000
concurrent users.


Real life differs from systems to systems :)
It is useful to see how dbms performs, but performance
of dbms heavily depends of how users use them.
(Isn't MySQL have severe performance penalty with complex
query like sub query?)


Yes, perhaps you can loan me the money to get Oracle and MSSQL licenses
so I can test them out?


I thought original poster would like to compare PostgreSQL
and MySQL.



What's this got to do with PHP? Nada... Happy New Year!


Compare performance PostgreSQL and MySQL using PHP?

Have a happy new year.

--
Yasuo Ohgaki


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] postgresql vs mysql

2002-12-27 Thread John W. Holmes
> This benchmark do not help much in real life, if one care database
> performance.

Did you even read the article? They used a real-world bookstore
application called Nile written in JSP and tested it with 50 to 1,000
concurrent users.
 
> Database performance will vary a lot with
configuration/schema/query/etc.
> It's very easy to make one is better while another is not.

Yes, that's why they fine tuned each one. They also invited each company
to send representatives to help them tune it. Only MySQL and Sybase did
so, IMB offered suggestions over email and apparently Oracle and
Microsoft couldn't be bothered. 

> I suggest to take benchmark by yourself with schema and query that
> is similar to production system. (Don't forget to test with large
enough
> data)

Yes, perhaps you can loan me the money to get Oracle and MSSQL licenses
so I can test them out?

I understand what you're saying, every application is different. Yes, I
agree, but for those that can't afford to do extensive benchmarking like
this, we have to use these results and assume ours will be the same. 

What's this got to do with PHP? Nada... Happy New Year!

---John Holmes...



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] postgresql vs mysql

2002-12-27 Thread Garry Climacosa
i emailed the author (dyck timothy) of this article (server database clash)
by eweek he told me that they benchmark DB's according to market share that
is why they didnt included PG (not widely used).

- Original Message -
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "'Boaz Yahav'" <[EMAIL PROTECTED]>; "'David Bryant'"
<[EMAIL PROTECTED]>; "'Ryan Jameson (USA)'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, December 28, 2002 5:12 AM
Subject: RE: [PHP-DB] postgresql vs mysql


I wish they had included PG on that list of databases. That would have
been good to see regardless of the results.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 27, 2002 3:58 PM
> To: David Bryant; Ryan Jameson (USA); [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] postgresql vs mysql
>
> This is why i was amazed to see this :
> http://www.mysql.com/eweek/index.html
>
> -Original Message-
> From: David Bryant [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 10:43 PM
> To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] postgresql vs mysql
>
>
> I've worked with both extensively. My personal preference is PG.
However,
> here are my findings over the years.
>
> The biggest factor in performance is the size of the database, more
than
> anything else. If you have a small and relatively simple RDB
structure,
> MySQL is significantly faster. (this is changing however. PG has made
some
> significant improvements in speed this last year, but MySQL is
improving
> performance considerably with larger and more complex RDBs.)
>
> PG has a much flatter performance line regardless of db size, whereas
> MySQL just gets much slower and slower as the db MB increases.
>
> -D
> AdPak Communications, Inc.
> Network Security Products, Sales & Support
> (623) 936-4800 * Toll Free 1-888-600-7066 * Fax: (623) 936-4111 Who Is
> Watching Your Network?
> Corporate/Sales/Service: www.adpak.com
>
> -Original Message-
> From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 1:18 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] postgresql vs mysql
>
>
> There's a substantiated rumor that says postgres is faster for complex
> queries.
>
> <>< Ryan
>
> -Original Message-
> From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 12:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] postgresql vs mysql
>
>
> I'm starting a project for which the lead programmer wants to use
> postgresql. I'll be working in php. Any major disadvantages to
> postgresql over mysql, other than mysql seems to be more widespread?
>
> TIA
> Ellen
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] postgresql vs mysql

2002-12-27 Thread Yasuo Ohgaki
This benchmark do not help much in real life, if one care database
performance.

Database performance will vary a lot with configuration/schema/query/etc.
It's very easy to make one is better while another is not.

I suggest to take benchmark by yourself with schema and query that
is similar to production system. (Don't forget to test with large enough
data)

BTW, SourceForge.net is using PostgreSQL. It's one of the biggest web site
using PostgreSQL that I know of. (I mean SourceForge.net system itself, not
database service available from sf.net. MySQL was more suitable for sharing
database server with many users until PostgreSQL 7.3)

--
Yasuo Ohgaki

Boaz Yahav wrote:

This is why i was amazed to see this : http://www.mysql.com/eweek/index.html

-Original Message-
From: David Bryant [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 10:43 PM
To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] postgresql vs mysql


I've worked with both extensively. My personal preference is PG. However, here are my findings over the years.

The biggest factor in performance is the size of the database, more than anything else. If you have a small and relatively simple RDB structure, MySQL is significantly faster. (this is changing however. PG has made some significant improvements in speed this last year, but MySQL is improving performance considerably with larger and more complex RDBs.)

PG has a much flatter performance line regardless of db size, whereas MySQL just gets much slower and slower as the db MB increases.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] postgresql vs mysql

2002-12-27 Thread John W. Holmes
I wish they had included PG on that list of databases. That would have
been good to see regardless of the results. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -Original Message-
> From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 27, 2002 3:58 PM
> To: David Bryant; Ryan Jameson (USA); [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] postgresql vs mysql
> 
> This is why i was amazed to see this :
> http://www.mysql.com/eweek/index.html
> 
> -Original Message-
> From: David Bryant [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 10:43 PM
> To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] postgresql vs mysql
> 
> 
> I've worked with both extensively. My personal preference is PG.
However,
> here are my findings over the years.
> 
> The biggest factor in performance is the size of the database, more
than
> anything else. If you have a small and relatively simple RDB
structure,
> MySQL is significantly faster. (this is changing however. PG has made
some
> significant improvements in speed this last year, but MySQL is
improving
> performance considerably with larger and more complex RDBs.)
> 
> PG has a much flatter performance line regardless of db size, whereas
> MySQL just gets much slower and slower as the db MB increases.
> 
> -D
> AdPak Communications, Inc.
> Network Security Products, Sales & Support
> (623) 936-4800 * Toll Free 1-888-600-7066 * Fax: (623) 936-4111 Who Is
> Watching Your Network?
> Corporate/Sales/Service: www.adpak.com
> 
> -Original Message-
> From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 1:18 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] postgresql vs mysql
> 
> 
> There's a substantiated rumor that says postgres is faster for complex
> queries.
> 
> <>< Ryan
> 
> -Original Message-
> From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 26, 2002 12:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] postgresql vs mysql
> 
> 
> I'm starting a project for which the lead programmer wants to use
> postgresql.  I'll be working in php.  Any major disadvantages to
> postgresql over mysql, other than mysql seems to be more widespread?
> 
> TIA
> Ellen
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] postgresql vs mysql

2002-12-27 Thread Boaz Yahav
This is why i was amazed to see this : http://www.mysql.com/eweek/index.html

-Original Message-
From: David Bryant [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 10:43 PM
To: 'Ryan Jameson (USA)'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] postgresql vs mysql


I've worked with both extensively. My personal preference is PG. However, here are my 
findings over the years.

The biggest factor in performance is the size of the database, more than anything 
else. If you have a small and relatively simple RDB structure, MySQL is significantly 
faster. (this is changing however. PG has made some significant improvements in speed 
this last year, but MySQL is improving performance considerably with larger and more 
complex RDBs.)

PG has a much flatter performance line regardless of db size, whereas MySQL just gets 
much slower and slower as the db MB increases.

-D 
AdPak Communications, Inc.
Network Security Products, Sales & Support
(623) 936-4800 * Toll Free 1-888-600-7066 * Fax: (623) 936-4111 Who Is Watching Your 
Network?
Corporate/Sales/Service: www.adpak.com
 
-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 1:18 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] postgresql vs mysql


There's a substantiated rumor that says postgres is faster for complex queries.

<>< Ryan

-Original Message-
From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] postgresql vs mysql


I'm starting a project for which the lead programmer wants to use postgresql.  I'll be 
working in php.  Any major disadvantages to postgresql over mysql, other than mysql 
seems to be more widespread?

TIA
Ellen


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] postgresql vs mysql

2002-12-26 Thread David Bryant
I've worked with both extensively. My personal preference is PG.
However, here are my findings over the years.

The biggest factor in performance is the size of the database, more than
anything else. If you have a small and relatively simple RDB structure,
MySQL is significantly faster. (this is changing however. PG has made
some significant improvements in speed this last year, but MySQL is
improving performance considerably with larger and more complex RDBs.)

PG has a much flatter performance line regardless of db size, whereas
MySQL just gets much slower and slower as the db MB increases.

-D 
AdPak Communications, Inc.
Network Security Products, Sales & Support
(623) 936-4800 * Toll Free 1-888-600-7066 * Fax: (623) 936-4111
Who Is Watching Your Network?
Corporate/Sales/Service: www.adpak.com
 
-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 26, 2002 1:18 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] postgresql vs mysql


There's a substantiated rumor that says postgres is faster for complex
queries.

<>< Ryan

-Original Message-
From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] postgresql vs mysql


I'm starting a project for which the lead programmer wants to use
postgresql.  I'll be working in php.  Any major disadvantages to
postgresql over mysql, other than mysql seems to be more widespread?

TIA
Ellen


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] postgresql vs mysql

2002-12-26 Thread Ryan Jameson (USA)
There's a substantiated rumor that says postgres is faster for complex queries.

<>< Ryan

-Original Message-
From: Ellen Solomon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 26, 2002 12:58 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] postgresql vs mysql


I'm starting a project for which the lead programmer wants to use
postgresql.  I'll be working in php.  Any major disadvantages to
postgresql over mysql, other than mysql seems to be more widespread?

TIA
Ellen


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] postgresql vs mysql

2002-12-26 Thread Ellen Solomon
I'm starting a project for which the lead programmer wants to use
postgresql.  I'll be working in php.  Any major disadvantages to
postgresql over mysql, other than mysql seems to be more widespread?

TIA
Ellen


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] postgresql and php - my codes running twice?!?!?

2002-11-06 Thread Zac Hillier
Hi,

Can anyone help I'm going mad with this...

I'm using postgresql with php and writing a small login and sign-up system.
Whena user wishes to sign-up Iwant to check there are not any other users
with the same username, so I'm doing a select against the db with the
requested username before allowing the insert to add the user to the db.

For some reason the code I'm using seems to be running through the fucntion
twice sometimes!!! and other times runs as it should!!!

Thanks for any help or ideas.

Zac



The code in the top of the html page calling the function:



The function it's self :

function Mmbr_SgnUp($ChkVal, $Rdr){
 /* Will check that each element in ChkVal array has a $_POST value not null
 Will check no duplicates of unique column
 Will redirect to success or fail with error message

 HTML Form Elements should be called
 Username, Password, Preffered, Reminder, Country,

 ChkVal array of element names to be checked
 Rdr page to redirect to if successful
 Standard begining to error message

 */

 $GLOBALS[dbgPos] = 'Mmbr_SgnUp function';

 if($GLOBALS[c01_debug]) echo ' Debugging from New Member Sign Up
Function ';

 // - - - - - - - -  define function vars
 // - - - - - - - - array for errors that occured
 $Err = array();
 // - - - - - - - -  array for noting missing elements in sign up
 $EmtErr = array();

 // - - - - - - - -  check that each form element has been completed
 ForEach($ChkVal as $val){
  // - - - - - - - -  if element is not set add element to error array
  if(!isset($_REQUEST[$val])){
   array_push($EmtErr,$val);
   $Err[0] = $GLOBALS[c01_Err_21];
  }
 }

 if($GLOBALS[c01_debug]){
  // - - - - - -  write ChkVal array to screen
  wrt_arr_scrn($ChkVal);
  echo 'Rdr = '.$Rdr.'';
 }

 // - - - - - - - -  Check for duplicate values in db
 // - - - - - - - -  create db connecion
 $Con = dbc();

 $Qry = dbq('SELECT "UsrId" FROM "Usr" WHERE "UsrId" =
'."'".$_REQUEST[Username]."'".';');

 for($r = 0 ; $r < 1; $r++){
  echo $r;
 }

 if($GLOBALS[c01_debug]) echo 'SELECT "UsrId" FROM "Usr" WHERE "UsrId" =
'."'".$_REQUEST[Username]."'".';';

 if(db_num_rows($Qry) > $GLOBALS[c01_0]){

  $Row = db_fetch_row($Qry);

  echo $Row[0];

  $Err[1] = $GLOBALS[c01_Err_20];

  if($GLOBALS[c01_debug]) echo ' Check for more than one entry NumRows
returned - '.db_num_rows($Qry).'';

  // - - - - - - - -  log new member sign-up failure
  wrt_log($GLOBALS[c01_log_level_usr],$GLOBALS[c01_t],'New_Member','***
FAILED Sign-up at '.$GLOBALS[c05_DteTme].', Username = '.$_POST[Username].',
Err[0] = '.$Err[0].', Err[1] = '.$Err[1]." \n");

  if($GLOBALS[c01_debug]) echo ' End Debugging from New
Member Sign Up Function ';

  // - - - - - - - -  return errors
  $Err["missing"] = $EmtErr;
  return $Err;

 } else {
  // - - - - - - - - Check if signup was successful

   if($GLOBALS[c01_debug]) echo'No Errors In passed data Proceding to write
to DB';

   // - - - - - - - -  insert record into db
   $cols = '"Sts","StsDtm","IniDtm","LgiDtm","Usr_MlcKey","UsrId","Pwd"';
   $vals =
'1,'."'".$GLOBALS[c05_Dte]."'".','."'".$GLOBALS[c05_DteTme]."'".','."'".$GLO
BALS[c05_DteTme]."'".','."'".$_POST[Country]."'".','."'".$_POST[Username]."'
".','."'".$_POST[Password]."'";

   if($_POST[Preffered] != ''){
echo 'pp'.$_POST[Preffered].'pp';
$cols.= ',"PrfNme"';
$vals.= ','."'".$_POST[Preffered]."'";
   }

   $Qry = dbq('INSERT INTO "Usr" ('.$cols.') Values ('.$vals.');');

   // - - - - - - - -  get usrid
   $Uid = db_insert_id($Qry);

   if($GLOBALS[c01_debug]) echo 'Get DB OID - '.$Uid.'';

   if($_POST[Reminder]){
// - - - - - - - -  add other details to Udt ~ password reminder
$Qry = dbq('INSERT INTO "Udt" ("Udt_UsrKey", "PwdRmd") VALUES ('.$Uid.',
'."'".$_POST[Reminder]."'".');');
   }

   // - - - - - - - - log new member sign-up

wrt_log($GLOBALS[c01_log_level_usr],$GLOBALS[c01_t],'New_Member','SUCCESSFUL
Sign-up at '.$GLOBALS[c05_DteTme].', UserId = '.$Uid." \n ");

   // - - - - - - - -  add freebies for becoming a new member
   $frb = add_frb('BNM001', $Uid);

   if($GLOBALS[c01_debug]) echo ' Add Freebies for Sign Up';

   // - - - - - - - -  login ~ which will result in redirect
   if($GLOBALS[c01_debug]) echo 'Now Goto Login Function to Log User in';
   if($GLOBALS[c01_debug]) echo ' End Debugging from New
Member Sign Up Function ';
   #Usr_Lgn($Rdr);
 }
}


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] PostgreSQL and HTML output

2002-10-18 Thread Edwin Robertson
With psql you can get all your output in HTML format.  Anyone know of a way
to do this in PHP?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] PostgreSQL and HTML output

2002-10-18 Thread Maarten Verheijen
Dear Robertson,

Try something like this with a simple table, create it like this in mysql:

CREATE TABLE HITS (
IDNR INTEGER AUTO_INCREMENT PRIMARY KEY,
REFFER VARCHAR(255),
HIT_DATE TIMESTAMP(8)
);


And the as a .php file, try something like this:
-


Simple outputpage for a MySQL-query



';
echo ''; echo $row[REFFER]; echo '';
echo ''; echo $row[HIT_DATE]; echo '';
echo '';
}
?>





--

If none of this makes any sense to you please start at the beginning,
Try http://www.devshed.com for some excellent tutorials.

Good Luck,
Maarten Verheijen





- Original Message -
From: "Edwin Robertson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, October 18, 2002 7:02 PM
Subject: [PHP-DB] PostgreSQL and HTML output


> With psql you can get all your output in HTML format.  Anyone know of a
way
> to do this in PHP?
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] PostgreSQL and HTML output

2002-10-18 Thread Jason Wong
On Saturday 19 October 2002 01:02, Edwin Robertson wrote:
> With psql you can get all your output in HTML format.  Anyone know of a way
> to do this in PHP?

The usual way is to write some code to do it.

If you don't want to write your own code search for some ready-made ones, 
ADOdb springs to mind.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
No matter where I go, the place is always called "here".
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] POSTGRESQL & PHP

2002-09-09 Thread TuxMonkey

You might also want to specify a user to connect as, otherwise the system
will assume you are trying to connect as the user you are logged in as.
Would defainately help a bit to know exactly what error your getting.

- Edwin

- Original Message -
From: "Miles Thompson" <[EMAIL PROTECTED]>
To: "Tomator" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, September 09, 2002 11:52 AM
Subject: Re: [PHP-DB] POSTGRESQL & PHP


> 1. run a script containing phpinfo() function and confirm you have support
> for pgsql
> 2. add code to display the error message generated by either php or pgsql
> when you try to connnect
> 3. (Maybe this should have been first) I don't know about Windows systems,
> but on *nix, PostgreSQL has to be started with the -i switch to be
> accessible from the Internet. Check docs.
>
> Hope this helps - Miles Thompson
>
> PS For help on the list #2 suggestion is really important.
>
> At 06:10 PM 9/9/2002 +0200, Tomator wrote:
> >I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP
script
> >working with pgsql base. I created database (typed "createdb name") but
when
> >trying execute script with "pg_connect("host=localhost dbname=name"); it
> >fails.
> >
> >Any suggestions?
> >
> >
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] POSTGRESQL & PHP

2002-09-09 Thread Tomator

"Miles Thompson" wrote:
> 1. run a script containing phpinfo() function and confirm you have support
> for pgsql
> 2. add code to display the error message generated by either php or pgsql
> when you try to connnect
> 3. (Maybe this should have been first) I don't know about Windows systems,
> but on *nix, PostgreSQL has to be started with the -i switch to be
> accessible from the Internet. Check docs.
>
> Hope this helps - Miles Thompson

Yes, it does :)
First, I had to remove one little semicolon in php.ini (extensions) and
configure extensions.patch. After restart of Apache PHP began to display
some errors that finally guided me to succesfull pg_connect.

Thanks!



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] POSTGRESQL & PHP

2002-09-09 Thread bbonkosk

Gosh..

It could be a bunch of things.  Maybe it requires a password, a username, is 
running on an alternate port, etc...
Any more information you can provide to us would be helpful.  Maybe echo out 
the output of pg_last_error()?

-Brad

> I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP script
> working with pgsql base. I created database (typed "createdb name") but when
> trying execute script with "pg_connect("host=localhost dbname=name"); it
> fails.
> 
> Any suggestions?
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] POSTGRESQL & PHP

2002-09-09 Thread Miles Thompson

1. run a script containing phpinfo() function and confirm you have support 
for pgsql
2. add code to display the error message generated by either php or pgsql 
when you try to connnect
3. (Maybe this should have been first) I don't know about Windows systems, 
but on *nix, PostgreSQL has to be started with the -i switch to be 
accessible from the Internet. Check docs.

Hope this helps - Miles Thompson

PS For help on the list #2 suggestion is really important.

At 06:10 PM 9/9/2002 +0200, Tomator wrote:
>I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP script
>working with pgsql base. I created database (typed "createdb name") but when
>trying execute script with "pg_connect("host=localhost dbname=name"); it
>fails.
>
>Any suggestions?
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] POSTGRESQL & PHP

2002-09-09 Thread Tomator

I've installed MySQL and PostgreSQL on my XP. I'd like to make an PHP script
working with pgsql base. I created database (typed "createdb name") but when
trying execute script with "pg_connect("host=localhost dbname=name"); it
fails.

Any suggestions?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] postgresql in windows

2002-07-16 Thread Turbano

Hi, i'm new in this news group, i want to know how can i install postgresql
at Windows XP, i found some tutorials, but using CygWin, i can't create the
database the scripts says:
"CREATE DATABASE
ERROR"

I found the ODBC driver, install, but can't connect, because he says for i
verify if my connection is set to localhost. Some one can help me?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] Postgresql Connection

2002-06-02 Thread smith

I was using PostgreSQL 7.1.3 before, and I have upgraded PostgreSQL to 7.2.1
in these days.

But after I upgraded the PostgreSQL server, I cannot connect it by the PHP
scripts.

It shows nothing , not even error message telling me what' going wrong?


Could anyone tell me how to solve this problem?

I am using PHP-4.0.4pl1-9.






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] PostgreSQL and Regular Expressions

2001-12-17 Thread GB Clark II

On Monday 17 December 2001 09:12, Joe Koenig wrote:
> I've been digging through the postgres docs and haven't found a way to
> use reg ex's in a query. Is there a simple way? Something similar to
> MySQL's RLIKE? I'm trying to select all records that start with a number
> [0-9]. Thanks,
>
> Joe
Take a look at postgresql's LIKE...:)

http://www7.us.postgresql.org/users-lounge/docs/7.1/user/functions-matching.html#FUNCTIONS-LIKE

One advantage I've found for postgresql is that if you've got a standard SQL 
book (I like the two books "The Practical SQL Handbook" and "Practical SQL" 
by Bowman, et al), you can just about use them as is without having to resort
to hacking the SQL.  It is very rare for me to even have to modify the SQL I 
get out of these books.

GB

-- 
GB Clark II | Roaming FreeBSD Admin
[EMAIL PROTECTED] | General Geek 
   CTHULU for President - Why choose the lesser of two evils?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL and Regular Expressions

2001-12-17 Thread Joe Koenig

I've been digging through the postgres docs and haven't found a way to
use reg ex's in a query. Is there a simple way? Something similar to
MySQL's RLIKE? I'm trying to select all records that start with a number
[0-9]. Thanks,

Joe

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PostgreSql query help....

2001-11-21 Thread GB Clark II

On Monday 19 November 2001 20:27, Vincent Ma wrote:
> Hi everybody:
>
>   I would like to ask why the error occur when retrieve current sequence
> number.  Eg. "select currval('student_id_seq')" is not working, and warning
> prompt "student_id_seq.currval is not yet defined in this session".
>
> However, this is work for the "select nextval()";
>
> do anyone know how to get current sequence number, in php.  Thank for your
> help
>
> Vincent Ma
Hi,

The problem here is that it looks like you have NOT inserted a record into 
the DB yet, therefore, you don't have a current value to get. 

currval gets the last inserted id number for this connection.  nextval will 
get the value that will be used next.  

If you are trying to get a id number for insertion (i.e. not using the 
automatic insert) that nextval is the one you should use.

NOTE:  If you are using transactions and do a rollback, you will have holes 
in your sequences.


Hope this helps.

GB

-- 
GB Clark II | Roaming FreeBSD Admin
[EMAIL PROTECTED] | General Geek 
   CTHULU for President - Why choose the lesser of two evils?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSql query help....

2001-11-19 Thread Vincent Ma

Hi everybody:

  I would like to ask why the error occur when retrieve current sequence
number.  Eg. "select currval('student_id_seq')" is not working, and warning
prompt "student_id_seq.currval is not yet defined in this session".

However, this is work for the "select nextval()";

do anyone know how to get current sequence number, in php.  Thank for your
help

Vincent Ma



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL connection problem #2

2001-11-18 Thread Laukó Péter

Hi,
I could solve part of the problem by creating a user and
database called 'www-data'. The new question is how can I
connect to an arbitrary database? (This seems to be a
configuration problem for me.) Since I have more sites on
the same server, I really need more db-s.

My previous letter was:
I try to connect to a PostgreSQL database from my php
script, and I get the following error:

Warning: Unable to connect to PostgreSQL server: FATAL 1:
Database "www-data" does not exist in
the system catalog. in
/home/lao/proj/hajnalcsillag/www/classes/DBConnection.php on
line 10

The code is:
con_string );
}
}

?>

The versions are:
PHP Version 4.1.0RC1
PostgreSQL 7.1.3
Apache/1.3.22
Debian sid

Could anyone help me please?
Thanks, Peter

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL connection problem

2001-11-16 Thread Laukó Péter

Hi,

I try to connect to a PostgreSQL database from my php
script, and I get the following error:

Warning: Unable to connect to PostgreSQL server: FATAL 1:
Database "www-data" does not exist in
the system catalog. in
/home/lao/proj/hajnalcsillag/www/classes/DBConnection.php on
line 10

The code is:
con_string );
}
}

?>

The versions are:
PHP Version 4.1.0RC1
PostgreSQL 7.1.3

Could anyone help me please?
Thanks, Peter


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL to MySQL

2001-11-01 Thread ax

hi

i have a .sql file that was dumped from PostgreSQL and i want to import that
into MySQL.
I haven't got a clue how i am gonna approach that. Can anyone suggest me a
good starting point? maybe a script or something that can perform the action
for me ???

ax



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL / PHP Overrun Error

2001-09-26 Thread Mike Rogers

I have just upgraded to the new PostgreSQL 7.1.3 (from 7.0.3) and have been
experiencing a pretty serious problem:
On one particular page, in what seems to be completely random instances,
I get buffer overruns and either 0-rows or a crashed apache child.  Turning
on PHP's --enable-debug, I receive the following [in httpd error log]:


[Wed Sep 26 06:21:12 2001]  Script:  '/path/to/script.php'
---
pgsql.c(167) : Block 0x086A6DF8 status:
Beginning:  Overrun (magic=0x, expected=0x7312F8DC)
  End:  Unknown
---

Sometimes it will actually crash mid-way (probably overwrote some valuable
code):
---
pgsql.c(167) : Block 0x08684290 status:
Beginning:  Overrun (magic=0x111A, expected=0x7312F8DC)
[Wed Sep 26 09:22:46 2001] [notice] child pid 8710 exit signal Segmentation
fault (11)

This problem is of great concern to me and I have been working for days
trying to debug it myself and find other reports, with little success.  The
line it claims to be failing on is PHP's ext/pgsql/pgsql.c on line 167 (by
what this claims) which is the following function [the
efree(PGG(last_notice)) line].

static void
_notice_handler(void *arg, const char *message)
{
PGLS_FETCH();

if (! PGG(ignore_notices)) {
php_log_err((char *) message);
if (PGG(last_notice) != NULL) {
efree(PGG(last_notice));
}
PGG(last_notice) = estrdup(message);
}
}


Can anyone provide further input as to why this is causing problems?  The
PHP code works sometimes and not others, and it seems to be only that one
script, so I do not believe it to be a hardware issue.

Any thoughts?  I can provide any further system information if needed.  I
have tried recompiling pgsql, php and apache with different optimizations
[including none at all and debug mode on as i have now] with little change
in the result.

Thanks in advance;
--
Mike

cc: pgp-db-help; pgp-dev


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] postgresql groups and users

2001-09-05 Thread Michiel_Lange

for my application in php I connect with a postgresql database.
In this database I have made users and groups, where 1 user can be the
member of many groups (n on m relation)
That works, but how do I let php find out if a user is a member of a
certain group?
I tried to get the relation out of the database and that worked, as far as
that I got a list like { group1, group2, group3 } (it's been a while, and I
write this from heart)
A solution (I was not happy with) was making users, and create a special
table with users and a table with groups and create a table that has both
user and group as the primary key, so there was a n on m relation possible.
In the group database I put a username and password (which is why I don't
like the solution) that should log into the database.

The whole reason is that I create buttons, and people who don't have the
rights should not even see the buttons...
Anyone who can help me out?


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Postgresql/PHP backend error

2001-08-20 Thread Nigel Gilbert

I have PHP 4.06, Postgres7.1 and Apache on a Solaris server.  Most of 
the time all works as expected.  Occasionally I get an database error:

Database error
There was a database error when accessing Database zwg:
pqReadData() -- backend closed the channel unexpectedly. This probably
means the backend terminated abnormally before or while processing the
request.
(while evaluating: SELECT serializedobject FROM objects WHERE name='Zurich')

[This error page is generated by my application; it displays the 
error reported by Postgresql and the SQL that caused the error].

The error is not caused by my SQL syntax, since this same code 
executes without a problem at other times.

Has anyone else seen an error like this? Where do I start looking for 
the cause?  Which backend is terminating abnormally (Postgresql or 
PHP?)  and why should it do that?

Nigel Gilbert



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL or SAPDB

2001-08-17 Thread Alexandre Santos

I'm starting a project and I have this doubt: Postgres or SAPDB? I have
some experience in Oracle, but I need a free DB.
Any idea?
Alex

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL connections within classes & collisions.

2001-08-15 Thread Justin Buist

I recently did a re-install of PostgreSQL and php4 on Debian, which has
broken some development code here.  None of the actual code has changed in
days, which I can verify against the CVS tree, so I know it's one of two
things:

a)  botched server config
b)  the code wasn't as robust as it should have been in the first place.

What I have is a class (db_postgres) which we use for all DB access within
the project.   The functions relative to what are breaking are as follows:

class db_postgres {
var $db_name = "ourdb";
var $db_user = "ouruserB";
var $db_conn;

// CORE FUNCTIONS
function get_connection() {
$this->db_conn = pg_connect("dbname=$this->db_name ".
"user=$this->db_user");
if ($this->db_conn == FALSE) {
echo "Internal warning:  Db connection not established.\n";
}
}

function execute_sql($sql) {
$result = pg_exec($this->db_conn, $sql);
if ($result == NULL) {
echo "Error executing following SQL:$sql\n";
}
return $result;
}

function get_rs($sql) {
// Returns an array of hashes
$this->get_connection();
$result = $this->execute_sql($sql);
if ($result == NULL)
return array();
$num = pg_numrows($result);
$result_set = array();
for($i = 0; $i < $num; $i++)
array_push($result_set, pg_fetch_object($result, $row++));
return $result_set;
}
[snip]
}

The following main php page (ommiting includes) works:

$db = new db_postgres;
$result = $db->get_rs("select * from vendor");
$result = $db->get_rs("select * from vendor");

However,
$db = new db_postgres;
$result = $db->get_rs("select * from vendor");
$db = new db_postgres;
$result = $db->get_rs("select * from vendor");

Will break on the second calls ot get_rs().  Yes, I -could- be passing
around the db handles, or passing around already instantiated class
objects, but this gets a bit messy.  Plus, everything was working dandy
with making two $db objects within a single page... which is why this
bothers me.

The actual PHP error upon the second call is:
"Warning: 1 is not a valid PostgreSQL link resource in ... [snip]"

Suggestions?

Justin Buist


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL errors on persistent connections in PHP 4.0.6

2001-06-28 Thread Jason k Larson

Hi -

I have discovered an issue in PHP 4.0.6 and PostgreSQL (I'm running 7.1.2)
where PHP will not return/show the entire error messages involving
PostgreSQL when using persistent connections.

A simple example would be:
[PHP 4.0.5] Unable to connect to PostgreSQL server: Password authentication
failed for user 'foobar'
[PHP 4.0.6] Unable to connect to PostgreSQL server: (null)

I have submitted a bug report and am working with whomever as best I can to
resolve, this is just an FYI.

Jason k Larson



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] PostgreSQL versus MySQL

2001-04-06 Thread The Hermit Hacker


Check out:

http://openacs.org/philosophy/why-not-mysql.html

and:

http://www.phpbuilder.com/columns/tim20001112.php3

On Fri, 6 Apr 2001, Matt Braynard wrote:

> Can someone outline the differences between the two? I am partial to MySQL
> from experience but want to get a good view of why one is better than the
> other.
>
> Also, I've heard that you will lose data with MySQL if a system failure
> should occur.
>
> Thanks.
>
> Matt
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>

Marc G. Fournier   ICQ#7615664   IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: [EMAIL PROTECTED]   secondary: scrappy@{freebsd|postgresql}.org


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL versus MySQL

2001-04-06 Thread Matt Braynard

Can someone outline the differences between the two? I am partial to MySQL
from experience but want to get a good view of why one is better than the
other.

Also, I've heard that you will lose data with MySQL if a system failure
should occur.

Thanks.

Matt


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] PostgreSQL and PHP - some Great Bridge news

2001-03-26 Thread Ned Lilly

All,

I'm pleased to announce two initiatives at Great Bridge aimed at 
improving the integration of PostgreSQL and PHP, and some exciting stuff 
that we're doing as a company to get behind PHP more fully.

First, Great Bridge is partnering with Zend Technologies to include a 
fully-integrated installation of PHP in an upcoming Web developer's 
edition of Great Bridge PostgreSQL.  In addition to 
professionally-supported PHP (and other open source Web technologies), 
we'll also give our customers the chance to purchase Zend's value-added 
PHP tools (IDE, cache, encoder, and more...)  Zend  is a major 
contributor to the open source PHP effort, and we're very happy to be 
working with them.

Secondly, we're pleased to announce that three PHP core developers have 
joined the Great Bridge advisory committee- Rasmus Lerdorf, the creator 
of PHP; Thies Arntzen, an expert in PHP-database connectivity; and 
Sascha Schumann, PHP author and provider of high-performance webchat 
solutions.  Rasmus, Thies, and Sascha will work with us to help craft 
our Web developer products and services, including (of course) a fully 
optimized free download package.  We'll be putting some development 
energy into the PHP-Postgres interface, and look for other ways the two 
open source projects can help each other.

We're also very interested in hacker feedback as to what you'd like to 
see in a software and service package that revolves around the Web 
development "stack."  What kind of tools, building blocks, and 
applications would you like to see commercially supported?  Don't be shy 
- please email me at [EMAIL PROTECTED] with any suggestions.  I'll 
also be at ApacheCon in a few weeks if you'd like to get together in person.

Thanks,
Ned

-- 

Ned Lilly e: [EMAIL PROTECTED]
Vice Presidentw: www.greatbridge.com
Evangelism / Hacker Relationsv: 757.233.5523
Great Bridge, LLCf: 757.233.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




FW: [PHP-DB] Postgresql PHP

2001-01-10 Thread Ronnie Esguerra



You will need the source file of PHP to build the pgsql function in the
module.

Ronnie



> -Original Message-
> From: Shaun Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 10, 2001 2:18 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Postgresql PHP
>
>
> Hi everyone,
>
> I'm sure this is a simple question but I'm just not too sure about it.
>
> Does anyone know if you require a RPM or Source to use the Postgresql PHP
> functions.
>
> I've installed the Postgresql Database and have the current PHP
> and mod-PHP.
>
> Thanks for all the help,
>
> --
> Shaun Mitchell
> Web Developer
> CADVision Internet (http://www.cadvision.com)
> A division of PSINet inc. [NASDAQ PSIX]
> 300 - 5th Avenue SW, Suite 1810
> Calgary, Alberta
> Email: [EMAIL PROTECTED]
> Phone: (403) 571-1344
> --
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]