Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Re: [PDO] Re: [PHP-DEV] Re: [PDO] Re: [PHP-DEV] [PATCH] New PDO methods for PostgreSQL driver [RSS Feed]

#1 June 14, 2010 10:22:51

Ferenc K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: [PDO] Re: [PHP-DEV] Re: [PDO] Re: [PHP-DEV] [PATCH] New PDO methods for PostgreSQL driver


>
> > I don't know sqlite or IBM, but the MySQL SELECT INTO OUTFILE is a plain
> SQL
> > statement, you don't need any special pdo function to use it, on the
> other
> > hand, you can't use the postgresql's COPY TO/FROM with PDO without the
> patch
> > above.
> > Did I misunderstood something?
>
> well, even if it's possible to do as "sql" in mysql, it is still possible
> to implement as the method.
>
> p.s. actually, as we're talking about "trunk" it is still possible to
> implement these methods in generic fashion.
> I can provide implementation for pdo_mysql (unless anyone else will be
> faster).
> does anyone know enough about ibm's api to provide implementation for it?
>
>
I don't think that is a good idea.
For example in mysql, you can SELECT INTO OUTFILE any sql result, for
postgresql, you can only import/export a table:http://www.postgresql.org/docs/8.1/static/sql-copy.htmlSo the two feature is different, and I can't see a point, that why should we
force different features into a common functionality.

For postgres I think we had to provide this functionality somehow, because
it was impossible to do this with through PDO.

But we think it over, before we over-generalize the function.

Tyrael

Offline

#2 June 15, 2010 03:04:47

Stanley S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Re: [PDO] Re: [PHP-DEV] Re: [PDO] Re: [PHP-DEV] [PATCH] New PDO methods for PostgreSQL driver


On Mon, Jun 14, 2010 at 2:21 AM, Ferenc Kovacs <i***@*yrael.hu> wrote:
>> > I don't know sqlite or IBM, but the MySQL SELECT INTO OUTFILE is a plain
>> > SQL
>> > statement, you don't need any special pdo function to use it, on the
>> > other
>> > hand, you can't use the postgresql's COPY TO/FROM with PDO without the
>> > patch
>> > above.
>> > Did I misunderstood something?
>>
>> well, even if it's possible to do as "sql" in mysql, it is still possible
>> to implement as the method.
>>
>> p.s. actually, as we're talking about "trunk" it is still possible to
>> implement these methods in generic fashion.
>> I can provide implementation for pdo_mysql (unless anyone else will be
>> faster).
>> does anyone know enough about ibm's api to provide implementation for it?
>>
>
> I don't think that is a good idea.
> For example in mysql, you can SELECT INTO OUTFILE any sql result, for
> postgresql, you can only import/export a table:
>http://www.postgresql.org/docs/8.1/static/sql-copy.html> So the two feature is different, and I can't see a point, that why should we
> force different features into a common functionality.

In the case of query export, the copyTo belongs at the statement level.
$stmt = $pdo->query("SELECT field1, anotherField from table where
field1 = 'somevalue');
$stmt->copyTo(args...)

Obviously, copyFrom at the statement level would not make sense.

In the case of a table export, at the driver level as it it for PostgreSQL.

Again, leaving it to the driver maintainer to either not-implement,
implement a compatibility layer using SQL or implement natively at the
library level.

> For postgres I think we had to provide this functionality somehow, because
> it was impossible to do this with through PDO.
> But we think it over, before we over-generalize the function.
> Tyrael
>

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Re: [PDO] Re: [PHP-DEV] Re: [PDO] Re: [PHP-DEV] [PATCH] New PDO methods for PostgreSQL driver [RSS Feed]

Board footer

Moderator control

Enjoy the 14th of December
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support