Error message

You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).

function DatabaseSchema_pgsql::dropPrimaryKey

Drop the primary key.

Parameters

$table: The table to be altered.

Return value

TRUE if the primary key was successfully dropped, FALSE if there was no primary key on this table to begin with.

Overrides DatabaseSchema::dropPrimaryKey

File

includes/database/pgsql/schema.inc, line 654

Class

DatabaseSchema_pgsql

Code

public function dropPrimaryKey($table) {
 if (!$this->constraintExists ($table, 'pkey')) {
 return FALSE;
 }
 $this->connection 
 ->query ('ALTER TABLE {' . $table . '} DROP CONSTRAINT ' . $this->ensureIdentifiersLength ($table, '', 'pkey'));
 return TRUE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.