sql = "SELECT SETVAL('" + sequenceName + "', (SELECT MAX(" + priKeyAttribute.columnName() +") FROM " + entity.externalName() +") INTO TEMP EOF_TMP_TABLE";
sql = "SELECT SETVAL('" + sequenceName + "', (SELECT MAX(" + priKeyAttribute.columnName() +") FROM " + entity.externalName() +")) INTO TEMP EOF_TMP_TABLE";
    public NSArray primaryKeySupportStatementsForEntityGroup(NSArray entityGroup) {        EOEntity entity;        int count;        int i;        NSMutableArray results;        NSArray priKeyAttributes;        EOAttribute priKeyAttribute;        String sequenceName;        results = new NSMutableArray();        count = entityGroup.count();        for ( i = 0 ; i < count ; i++ ) {            entity = (EOEntity)entityGroup.objectAtIndex(i);            priKeyAttributes = entity.primaryKeyAttributes();            if ( priKeyAttributes.count() == 1 ) {                priKeyAttribute = (EOAttribute) priKeyAttributes.objectAtIndex(0);                String sql;                sequenceName = PostgresqlPlugIn.sequenceNameForEntity(entity);                sql = "CREATE SEQUENCE " + sequenceName;                results.addObject(createExpression(entity, sql));                                sql = "SELECT SETVAL('" + sequenceName + "', (SELECT MAX(" + priKeyAttribute.columnName() +") FROM " + entity.externalName() +") INTO TEMP EOF_TMP_TABLE";                results.addObject(createExpression(entity, sql));                                sql = "DROP TABLE EOF_TMP_TABLE";                results.addObject(createExpression(entity, sql));                                sql =  "ALTER TABLE "+ entity.externalName() +" ALTER COLUMN "+ priKeyAttribute.columnName() +" SET DEFAULT nextval( '"+ sequenceName+ "' )" ;                results.addObject(createExpression(entity, sql));            }        }        return results;    }