Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statistics tab does not work using postgres database #17

Closed
vigdail opened this issue Apr 22, 2023 · 2 comments
Closed

Statistics tab does not work using postgres database #17

vigdail opened this issue Apr 22, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@vigdail
Copy link

vigdail commented Apr 22, 2023

In case I'm using postgres database, when I open the statistics tab it shows up blank. But if I use sqlite statistics tab works fine.

Error log:

postgres         | 2023-04-22 07:23:28.562 UTC [33] ERROR:  column "transaction.uid" must appear in the GROUP BY clause or be used in an aggregate function at character 8
postgres         | 2023-04-22 07:23:28.562 UTC [33] STATEMENT:  SELECT uid, category_id, account_id, SUM(amount) as amount FROM "transaction" WHERE (uid=$1 AND deleted=$2 AND (type=$3 OR type=$4) AND transaction_time>=$5 AND transaction_time<=$6) GROUP BY category_id, account_id
ezbookkeeping    | 2023-04-22 13:23:28 [REQUEST] 200 0 3612385602822995968 192.168.0.199 GET /api/v1/transactions/statistics.json?start_time=1680285600&end_time=1682877599 11ms, r=ed7d581c-5e28-5d1b-0000-0034c0a800c7

Ezbookkeeping docker image: mayswind/ezbookkeeping:SNAPSHOT-20230421
Postgres image: postgres:14.1-alpine

my docker-compose.yml
version: "2"
services:
  ezbookkeeping:
    image: mayswind/ezbookkeeping:SNAPSHOT-20230421
    container_name: ezbookkeeping
    hostname: "ezbookkeeping"
    ports:
      - "80:8080"
    networks:
      - db
    depends_on:
      - "db"
    environment:
      - "EBK_SERVER_DOMAIN=ezbookkeeping.local"
      - "EBK_SERVER_ENABLE_GZIP=true"
      - "EBK_DATABASE_TYPE=postgres"
      - "EBK_DATABASE_HOST=db:5432"
      - "EBK_DATABASE_NAME=ezbookkeeping"
      - "EBK_DATABASE_USER=ezbookkeeping"
      - "EBK_DATABASE_PASSWD=ezbookkeeping"
      - "EBK_LOG_MODE=console file"
      - "EBK_SECURITY_SECRET_KEY=my_security_code"
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/var/log/ezbookkeeping:/var/log/ezbookkeeping"
  db:
    image: postgres:14.1-alpine
    container_name: postgres
    restart: always
    environment:
      - POSTGRES_USER=ezbookkeeping
      - POSTGRES_PASSWORD=ezbookkeeping
    ports:
      - '5432:5432'
    networks:
      - db
    volumes:
      - db:/var/lib/postgresql/data
networks:
  db:
volumes:
  db:
    driver: local
@mayswind mayswind self-assigned this Apr 22, 2023
@mayswind mayswind added the bug Something isn't working label Apr 22, 2023
@mayswind
Copy link
Owner

the latest code has fix this problem.

@vigdail
Copy link
Author

vigdail commented Apr 23, 2023

Works fine, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants