Re: Sequences in DB/pgsql (once again)
| From: | Stig S. Bakken | Date: | Fri, 15 Dec 2000 03:49:53 +0000 |
| Subject: | Re: Sequences in DB/pgsql (once again) | ||
| References: | 1 | Groups: | php.pear |
| Request: | Send a blank email to php-pear+get-695@lists.php.net to get a copy of this message | ||
Alexey Borzov wrote:
>
> Greetings!
>
> Well, I made an update of PEAR and found sequence implementation...
> First of all, I honestly don't think that
>
> if ($ondemand && DB::isError($result) &&
> $result->getMessage() == "DB Error: ERROR: db_seq_test.nextval: sequence does not
> exist\n") {
>
> is the intended behaviour... ;]
> Relying on error messages' format is probably a Bad Thing itself...
It's rewritten now, this time it checks if getCode() is
DB_ERROR_NOSUCHTABLE, like in DB_mysql. There still be dragons though,
the error mapping in postgres just _has_ to be ugly.
> As for 'db_seq_{$seq_name}' - I don't think that prepending *anything* to
> table (or sequence) name is good. The reasons are simple -
> prefixes are usually used for hiding something or grouping (if a table
> name begins with 'pg_' in Postgres - it is a system table, if it
> begins with 'pga_' - it is a PgAccess table and is not shown in
> PgAccess). Besides, 'db_' prefix is misleading.
Reasons accepted. I have changed DB_mysql and DB_pgsql to use _seq
instead of db_seq_. We have until PHP 4.0.5 to decide if this is the
final standard. :-)
- Stig