PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB_DataObject » Bug #5405

Primary key and postgres tables

Details

Submitted2005-09-14 21:31 UTC
Fromcarlosjordao at gmail dot com
StatusBogus
PackageDB_DataObject
PHP Version4.3.11
OSLinux Conectiva 10
Roadmaps(Not assigned)

Comments

[2005-09-14 21:31 UTC] carlosjordao at gmail dot com

Description:
------------
The primary keys doesn't appear into .ini file if the schema.table returns data in PostgreSQL.

In the function _pgFieldFlags, in pgsql.php, the last query that use the table name won't work, on postgres, if table name has the schema in.

I guess this should be specific too because my tables were
created without primary key definition. They were included
after that with ALTER TABLE command.

[2005-09-16 13:24 UTC] carlosjordao at gmail dot com

sorry, I've put it under the wrong package!

[2005-09-16 13:41 UTC] carlosjordao at gmail dot com

the postgres version is 7.4

[2005-09-19 13:45 UTC] carlosjordao at gmail dot com

sure!

1- First, set up the database tables
====================================
create table t1 ( f1 integer not null, f2 integer, f3 varchar(20) );
alter table t1 add primary key (f1);

2- Setting up the base.ini file...
====================================
[DB_DataObject]
database = pgsql://postgres:@oracle/test
schema_location = /root/www/DataObjects/
class_location = /root/www/DataObjects/
require_prefix = DataObjects
class_prefix = DataObjects_
proxy = full

3- Executing the createTable.php script
=======================================
php /usr/share/pear/DB/DataObject/createTables.php /root/www/base.ini

4- Now, let's look into test.ini
=====================================
cat DataObjects/test.ini

[public.t1]
f1 = 1
f2 = 1
f3 = 2

[public.t1__keys]

[2005-09-19 13:53 UTC] carlosjordao at gmail dot com

And I guess this you want to know too:

Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.1 stable
Console_Getopt 1.2 stable
DB 1.7.6 stable
DB_DataObject 1.7.15 stable
Date 1.4.3 stable
HTML_Template_IT 1.1 stable
HTTP 1.3.6 stable
Log 1.8.7 stable
Mail 1.1.4 stable
Mail_Mime 1.2.1 stable
Net_SMTP 1.2.6 stable
Net_Socket 1.0.6 stable
Net_UserAgent_Detect 2.0.1 stable
PEAR 1.4.0 stable
XML_Parser 1.2.6 stable
XML_RPC 1.4.2 stable