Skip to content

postgresql not work #123

@WeatherRouteing

Description

@WeatherRouteing

import aisdb

Establish a connection to the SQLite database and decode messages from the CSV file

with aisdb.SQLiteDBConn('test_decode_msgs2.db') as dbconn:
aisdb.decode_msgs(filepaths=["AIS_2023_01_01.csv"],
dbconn=dbconn, source='Testing', verbose=True)

psql connection string

USER = 'postgres'
PASSWORD = 'asdasdaw'
ADDRESS = 'localhost'
PORT = 5432
DBNAME = 'noaa'
psql_conn_string = f"postgresql://{USER}:{PASSWORD}@{ADDRESS}:{PORT}/{DBNAME}"
filepaths = ['AIS_2023_01_01.csv',]

使用 aisdb.PostgresDBConn 和 aisdb.decode_msgs

with aisdb.PostgresDBConn(libpq_connstring=psql_conn_string) as dbconn:
aisdb.decode_msgs(filepaths,
dbconn=dbconn,
source='NOAA',
verbose=False,skip_checksum=True)

I want to know why the same data can be stored in SQLite but cannot be stored in PostgreSQL. The error message is:
generating file checksums...
checking file dates...
creating tables and dropping table indexes...
saving checksums...
error processing AIS_2023_01_01.csv, skipping checksum...
cleaning temporary data...
rebuilding indexes...
indexing 202001...
aggregating static reports into static_202001_aggregate...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions