<PAGE>   1
                          [DAVIS & COMPANY LETTERHEAD]
                                                                     EXHIBIT 5.1



July 28, 1999


Pivotal Corporation
300 - 224 West Esplanade
North Vancouver, B.C.  V7M 3M6

Ladies and Gentlemen:

Re:      Registration Statement on Form F-1 of Pivotal Corporation ("Pivotal" or
         the "Company")
________________________________________________________________________________

         We have acted as Canadian counsel to the Company in connection with the
authorization and issuance by Pivotal of up to 3,500,000 common shares of the
Company together with an additional 525,000 common shares, if and to the extent
the underwriters exercise an over-allotment option granted by the Company
(together, "Shares"), and the preparation and filing of a registration statement
on Form F-1 ("Registration Statement") under the Securities Act of 1933, as
amended ("Securities Act"), which the Company is filing with the Securities and
Exchange Commission with respect to the Shares.

         We have examined the Registration Statement and such documents and
records of the Company and other documents as we have deemed necessary for the
purpose of this opinion. We have assumed, with your permission and without
independent investigation, (i) the genuineness of all signatures, the
authenticity of all documents submitted to us as originals, the conformity to
original documents of all documents submitted to us as photostatic or facsimile
copies, and the authenticity of the originals of such copies, (ii) the accuracy
of the factual representations made to us by officers and other representatives
of the Company, whether evidenced by certificates or otherwise, (iii) the
identity and capacity of all individuals acting or purporting to act as public
officials, and (iv) that all actions contemplated by the Registration Statement
have been and will be carried out only in the manner described therein.

         Based upon the foregoing, we are of the opinion that upon the happening
of the following events:


<PAGE>   2

                                      -2-

                                DAVIS & COMPANY


         (a)      the filing of the Registration Statement and any amendments
                  thereto and the Registration Statement becoming effective; and

         (b)      the sale of the Shares and the receipt by the Company of an
                  amount equal to the full consideration for the Shares as
                  contemplated by the Registration Statement; and

         (c)      the due issuance by the Company and registration by its
                  registrar of the Shares;

the Shares will be duly authorized, validly issued, fully paid and
non-assessable.

         In rendering this opinion we express no opinion as to the laws of any
jurisdiction other than the laws of the Province of British Columbia and the
federal laws of Canada applicable therein.

         We hereby consent to the filing of this opinion as an exhibit to the
Registration Statement and to the reference to our firm in the Prospectus made
part of the Registration Statement under the heading "Legal Matters". In giving
such consent, we do not admit that we are in the category of persons whose
consent is required under Section 7 of the Securities Act. This Consent may be
incorporated by reference in any amendment to the Registration Statement filed
pursuant to Rule 462(b) of Regulation C under the Securities Act.

Yours truly,

/s/ DAVIS & COMPANY

DAVIS & COMPANY