MagicStack / MagicStack/asyncpg

Does COPY FROM gaurentee no partial rows?

Offen
#344 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
8.1k
Forks
468
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

A quick question, since this is not very obvious from the postgres or asyncpg docs: under what circumstances, if any, does copy_from_query guarantee that no partial rows will be delivered to the output coroutine?

In my experience this hasn't happened, and I could try some more exhaustive testing, but I imagine/hope that someone might just already know the answer.

To me the options seem to be:

  • If the networking code reads one line at a time, then the 'text' format guarantees full rows, but not necessarily 'csv' or 'binary'
  • Asyncpg itself or postgres itself may explicitly implement such a guarantee?
  • Otherwise, there is no guarantee.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit der PostgreSQL- und asyncpg-Dokumentation zu copy_from_query und verfolge anschließend, wie deren Ausgabekoroutine in den verfügbaren asyncpg-Materialien beschrieben wird. Dokumentiere die Umstände, sofern vorhanden, unter denen Text-, CSV- und Binärausgabe unvollständige Zeilen vermeiden, und stelle die Garantie für Benutzer klar dar.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
postgresql, python
Bereich
databases
Issue-Typ
Dokumentation
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.