Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 6950A6500E1 for ; Tue, 21 Oct 2008 18:57:10 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 93966-02 for ; Tue, 21 Oct 2008 18:57:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.187]) by postgresql.org (Postfix) with ESMTP id 1DCA86500DD for ; Tue, 21 Oct 2008 18:57:04 -0300 (ADT) Received: by ti-out-0910.google.com with SMTP id y8so1603963tia.5 for ; Tue, 21 Oct 2008 14:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=TX4rVc0UIIKiqQAsRfTAdALRqPfXFR7iNAmPro/poug=; b=poDtS69lMUPSEQ6W4hCU4iDzd8rZMG/BwKYix4+AAcMNUhTSyi5ffKOlx+n4EV6jmB G4SqJvyZkXxuDypj4b0LAYGsZ8bfer59xAUP5F396cNddScB4W1rQX9Yxok439DF86NO 4/jKNh6O0q4Lh7GSAlgBWwXzGFEQR3FniPLQk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=n4zm6rskxmnjthQJB1qwc++81yMwTlabVCafeOFI4O1+wlfC8Qv9+9h94k3YIkVRUv g8B5KG1oTj47vQ2mY4iXBGupcszUP8b6m90TTmigecSu2A3za5kytuFWUbkZRRKPdjWS Jhk/HBwCmr4GZtAD9cg8gCTfM5GytVcsho3Qc= Received: by 10.110.52.1 with SMTP id z1mr6356321tiz.44.1224626222586; Tue, 21 Oct 2008 14:57:02 -0700 (PDT) Received: from ?192.168.0.70? (office.squiz.net [203.206.128.174]) by mx.google.com with ESMTPS id 2sm10105713tif.0.2008.10.21.14.57.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Oct 2008 14:57:02 -0700 (PDT) Message-ID: <48FE502A.5090707@gmail.com> Date: Wed, 22 Oct 2008 08:56:58 +1100 From: Chris User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: elmarkivp CC: pgsql-php@postgresql.org Subject: Re: store files encrypted with pgcrypto References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/14 X-Sequence-Number: 3911 elmarkivp wrote: > Hi, i'm trying to store files encrypted in postgres 8.3.4, using > sym_encrypt_bytea function. > this is quoted from the postgres8.3 documentation, thats was my guide, > below is the php code i have used to make it, with no results and the > respective errors. > > FROM http://www.postgresql.org/docs/8.3/static/pgcrypto.html > > F.20.3.1. pgp_sym_encrypt() > > pgp_sym_encrypt(data text, psw text [, options text ]) returns bytea > pgp_sym_encrypt_bytea(data bytea, psw text [, options text ]) > returns bytea > > > Encrypt data with a symmetric PGP key psw. The options parameter can > contain option settings, as described below. > F.20.3.2. pgp_sym_decrypt() > > pgp_sym_decrypt(msg bytea, psw text [, options text ]) returns text > pgp_sym_decrypt_bytea(msg bytea, psw text [, options text ]) returns > bytea > > ERRORS: > ERROR: No function matches the given name and argument types. You > might need to add explicit type casts > ERROR: function pgp_sym_encrypt_bytea(unknown, integer, unknown) does > not exist pgcrypto is a contrib module in pg 8.3 (ie not built in by default). Did you install the module? There are instructions on how to do that here: http://www.postgresql.org/docs/8.3/static/contrib.html -- Postgresql & php tutorials http://www.designmagick.com/