Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gksJl-0006ZA-6G for pgsql-interfaces@arkaria.postgresql.org; Sat, 19 Jan 2019 15:13:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gksJj-000642-Vd for pgsql-interfaces@arkaria.postgresql.org; Sat, 19 Jan 2019 15:13:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gksJj-0005q6-J5 for pgsql-interfaces@lists.postgresql.org; Sat, 19 Jan 2019 15:13:51 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gksJg-00062W-Po for pgsql-interfaces@lists.postgresql.org; Sat, 19 Jan 2019 15:13:50 +0000 Received: by mail-qt1-x844.google.com with SMTP id r14so18598925qtp.1 for ; Sat, 19 Jan 2019 07:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=kj6XiwblB2WTD6gFt6KmssOcvgXs9YV1pVUfSgF3eZc=; b=RVSVlOGahbS91eIjcT4CAqTIy0PFyEhxjeIIZ4+8r5f4pPRPVHeXJjycvlwBw/h3Vr EqsLjCBe0sAo917y9vjqgZPu0gQW14syBB5jzkR6qkQnTDeXYbwxYGCkarF4CSZNNuAA 639NHrl2fHMW71Dcia2m8o7Ib+s89A3YRWdxZTBnmxc7iqUCURDy/9KnvzXjIkw8JYEo rR6wEnNHmigHRdMrqeT22gXXq2UbsU1U8gCt3HUTtcfnkPwGrn1WeYxKAimD15pM7tQM Pgh5QBVcCzER9aCe4XCmtWzEIzItYSjjII+jDSZkmczPj9Q70A+cNOrd73h6J3wiEfTB STuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=kj6XiwblB2WTD6gFt6KmssOcvgXs9YV1pVUfSgF3eZc=; b=qRSUdkiGucAYFJpd2aPJmZrFgcUu+8av/UlZX7dGHcebyn6ZMddwvUwoSvPMztNbQQ 941/lDyCzq/08MAnS9dN0iCKqwKSiUw8kYmANQXDd9j6vUhNGZFEBJz6gswo6gxYxp7q B+Dc/kGLEH2llZwqShd4pw8bnJwPGJV4tjgbyi36hnt1H7XbhSs9dTqYLhBTnzouEpIJ zFItgJ/4xg7fvq3yzRSAiBc3ng5LbahhjhJzCvbcUwx0gSoNQdtxRaFsuR+ZY2VTmzVF eZt0EeIOf5tRcV5aHgVB/XrR8//VjYe3u+G+Jh27xM5rfjYytd8nEiPrK45f98UrHRH/ mInQ== X-Gm-Message-State: AJcUukdeZvGGUntfNXy1IIN6NqXxfV3nJNLn81i3+ORdCkj7OOJ5EBcA bn649N73cOVGbxaWNnoZ9/VK/hhC26X7loZiiYc= X-Google-Smtp-Source: ALg8bN7aXkiktcKoeRixD7jl+tbwAoUziAFe4MubhFJV5T6TpYu68OWBYhbEHmfHkzH8Yw7Wj4HdvsbOYXho4UgY1JI= X-Received: by 2002:aed:358b:: with SMTP id c11mr19621844qte.155.1547910827293; Sat, 19 Jan 2019 07:13:47 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Dmitry Igrishin Date: Sat, 19 Jan 2019 18:16:31 +0300 Message-ID: Subject: Re: the wire protocol To: Catonano Cc: pgsql-interfaces@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk =D1=81=D0=B1, 19 =D1=8F=D0=BD=D0=B2. 2019 =D0=B3. =D0=B2 16:56, Catonano : > > Hello, > > there's this Python project using the so called wire protocol (as far as = I understand) > > https://github.com/MagicStack/asyncpg > > I'm caressing the idea to create a GNU Guile based project that does the = same thing > > But I don't understand how they manage to get the connection to Postgresq= l, their code is too complicated for me > > Do they use the C library, libpq ? > Or do they manage the connection in their own code ? AFAIK, asyncpg implements the frontend/backend protocol described here: https://www.postgresql.org/docs/current/protocol.html > Should I use libpq ? Not necessary. > Or should I manage the connection in my own code ? You can implement the protocol yourself in pure Guile. It's up to you to de= cide. > In Guile I can manipulate sockets and the semantics are pretty close to t= he ones of plain C > > So even an example in C would be fine > > I'd like to use a Unix socket To do it, first of all you need to familiarize with the frontend/backend protocol mentioned above.