{"id":26239848,"url":"https://github.com/pgsuite/pgxls","last_synced_at":"2026-03-14T20:52:29.001Z","repository":{"id":222685849,"uuid":"672247995","full_name":"PGSuite/PGXLS","owner":"PGSuite","description":"Report bulder and export to Excel from PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-03-23T17:25:06.000Z","size":101,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-28T09:47:25.386Z","etag":null,"topics":["builder","excel","postgresql","report"],"latest_commit_sha":null,"homepage":"https://pgxls.org","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PGSuite.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-29T12:25:48.000Z","updated_at":"2025-03-23T17:32:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"e3057c57-4729-40a0-8592-1d159a0a0011","html_url":"https://github.com/PGSuite/PGXLS","commit_stats":null,"previous_names":["pgxls/pgxls","pgsuite/pgxls"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PGSuite/PGXLS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSuite%2FPGXLS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSuite%2FPGXLS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSuite%2FPGXLS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSuite%2FPGXLS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PGSuite","download_url":"https://codeload.github.com/PGSuite/PGXLS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PGSuite%2FPGXLS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30517530,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-14T19:51:21.629Z","status":"ssl_error","status_checked_at":"2026-03-14T19:51:12.959Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["builder","excel","postgresql","report"],"created_at":"2025-03-13T07:17:28.718Z","updated_at":"2026-03-14T20:52:28.983Z","avatar_url":"https://github.com/PGSuite.png","language":"PLpgSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## PGXLS | Report bulder and export to Excel from PostgreSQL\n\nTool `PGXLS` is schema with stored procedures for creating files (bytea type) in Excel format (.xlsx).  \nImplemented dependence format on data type, conversion SQL query into sheet with autoformat and more.\n\n### Installation ###\n\nThe installer is [pgxls_init.sql](https://github.com/PGSuite/PGXLS/raw/main/pgxls_init.sql) file that creates `pgxls` schema with the necessary procedures.  \nThe installation consists in executing it in the psql terminal client or SQL manager, for example:  \n\n```bash\nwget -O - -q https://github.com/PGSuite/PGXLS/raw/main/pgxls_init.sql | psql -d [database]\n```\n### Extension ###\n\nTo install `PGXLS` as an extension, unpack the [pgxls_extension.tar](https://github.com/PGSuite/PGXLS/raw/main/extension/pgxls_extension.tar) archive into the [sharedir]/extension directory of the postgres installation, for example (run as root):\n\n```bash\nwget -O - -q https://github.com/PGSuite/PGXLS/raw/main/extension/pgxls_extension.tar | tar x -C `su - postgres -c \"pg_config --sharedir\"`/extension\n```\nMore info on page [download](https://pgxls.org/en/download/)\n\n### Example #1 ###\n\nCreate and get file (bytea) by SQL query\n```sql\nselect pgxls.get_file_by_query('select * from pg_class');\n```\n\nSave Excel file on server by SQL query\n```sql\ncall pgxls.save_file_by_query('/tmp/top_relations_by_size.xlsx', 'select oid,relname,pg_relation_size(oid) from pg_class order by 3 desc limit 10')\n```\n\nSave file on command line \n```bash\npsql -Aqt -c \"select pgxls.get_file_by_query('select * from pg_class')\" | xxd -r -ps \u003e pg_class.xlsx\n```\n\n### Example #2 ###\n\n```sql\n-- Create function that returns file (bytea)\ncreate or replace function excel_top_relations_by_size() returns bytea language plpgsql as $$\ndeclare \n  rec record;\n  xls pgxls.xls; \nbegin\n  -- Create document, specify widths and captions of columns in parameters\n  xls := pgxls.create(array[10,80,15], array['oid','Name','Size, bytes']);\n  -- Select data in loop\n  for rec in\n    select oid,relname,pg_relation_size(oid) size from pg_class order by 3 desc limit 10    \n  loop\n    -- Add row\n    call pgxls.add_row(xls);\n    -- Set data from query into cells\n    call pgxls.put_cell(xls, rec.oid);      \n    call pgxls.put_cell(xls, rec.relname);   \n    call pgxls.put_cell(xls, rec.size);\n  end loop;  \n  -- Returns file(bytea)\n  return pgxls.get_file(xls);      \nend\n$$;\n-- Get file\nselect excel_top_relations_by_size();\n```\n\nSave file on command line\n```bash\nsql -Aqt -c \"select excel_top_relations_by_size()\" | xxd -r -ps \u003e top_relations_by_size.xlsx\n```\n\nAll examples in directory [example](https://github.com/PGSuite/PGXLS/tree/main/example)\n\n### Basic procedures ###\n  \n*   **pgxls.create** - create document\n  \n*   **pgxls.add_row** - add row\n  \n*   **pgxls.put_cell** - fill cell: set value and format\n  \n*   **pgxls.get_file** - build and get file\n\n*   **pgxls.get_file_by_query**\t- create file by SQL query (wrapper)\n\n\nDocumentation in file [documentation/documentation.html](https://htmlpreview.github.io/?https://github.com/PGSuite/PGXLS/blob/main/documentation/documentation.html)\n\n\n### Important qualities ### \n\n*   **Large files** - data row by row inserted into temporary table, which not requires memory. Separate function is implemented to get large file\n*   **Auto-format** - for each column, format is configured depending on data type\n*   **SQL queries** - it is possible to add sheet with the results of SQL query\n*   **Styles**      - for columns and cells, support format, font, border, fill and alignment\n*   **Print setup** - for each sheet, the paper format and orientation, title, repeating rows (table header) and margins are specified\n*   **Parallelism** - possible to create several files in parallel in one session\n\nOverview on site [pgxls.org](https://pgxls.org/en/)\n\n### Support ### \n\nOf course you can create an issue, I will answer all requests.  \nAlso I will help to install and use the tool.  \nWelcome to discussion !  \n\nWhatsApp: [PGSuite (+7-936-1397626)](https://wa.me/79361397626)  \nemail: [support\\@pgsuite.org](mailto:support@pgsuite.org?subject=PGXLS)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgsuite%2Fpgxls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpgsuite%2Fpgxls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpgsuite%2Fpgxls/lists"}