Re: [Python] Formatage d'une requête SQL

From: Denis Bitouzé <dbitouze(at)wanadoo(dot)fr>
To: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
Cc: pgsql-fr-generale(at)postgresql(dot)org
Subject: Re: [Python] Formatage d'une requête SQL
Date: 2010-01-27 14:50:02
Message-ID: 20100127155002.0a11cbb2@drums
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-fr-generale

Le mercredi 27/01/10 à 15h32,
Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr> a écrit :

> On Wed, Jan 27, 2010 at 03:19:21PM +0100,
> Denis Bitouzé <dbitouze(at)wanadoo(dot)fr> wrote
> a message of 34 lines which said:
>
> > Je souhaiterais pouvoir récupérer le résultat d'une requête sous son
> > formatage habituel,
>
> Pourquoi ne pas utiliser les mécanismes de formatage de Python, comme
> le paquetage formatter <http://docs.python.org/library/formatter.html>
> ou <http://docs.python.org/library/string.html> ?

Pour ne pas me fatiguer : je trouve celui de Postgresql tout à fait
suffisant pour l'instant ;)

> > Dans un script bash, cela se fait aisément en utilisant l'interface
> > à PostgreSQL en ligne de commandes qu'est psql. Mais cela est-il
> > possible directement en python ?
>
> Ben, exactement de la même façon, en appelant psql.
>
> http://docs.python.org/library/subprocess.html

Ah, parfait !

Merci.
--
Denis

In response to

Browse pgsql-fr-generale by date

  From Date Subject
Next Message Denis Bitouzé 2010-01-27 14:51:20 Re: Re: [pgsql-fr-generale] [Python] Formatage d'une requête SQL
Previous Message Christophe Chauvet 2010-01-27 14:41:24 Re: [pgsql-fr-generale] [Python] Formatage d'une requête SQL