{"id":22614349,"url":"https://github.com/melchisedech333/c-postgresql","last_synced_at":"2026-02-17T14:33:55.552Z","repository":{"id":65762181,"uuid":"545124489","full_name":"melchisedech333/c-postgresql","owner":"melchisedech333","description":":elephant: Introductory examples for people who want to use PostgreSQL with the C language. In the examples, the most basic operations to manage the database were covered, namely: connecting, creating tables, inserting records, selecting data, updating and deleting records.","archived":false,"fork":false,"pushed_at":"2022-10-17T19:12:42.000Z","size":195,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T10:32:11.092Z","etag":null,"topics":["c","connector-library","cpp","cpp-sql","database-postgresql","postgre-sql","postgres","postgres-database","postgres-databases","postgres-db","postgres-sql","postgresql","postgresql-connector","postgresql-database","postgresql-databases","postgresql-driver","postgress","relational-database","relational-database-fundamentals","relational-databases"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melchisedech333.png","metadata":{"files":{"readme":"readme-pt.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["melchisedech333"]}},"created_at":"2022-10-03T20:33:22.000Z","updated_at":"2023-02-08T15:57:06.000Z","dependencies_parsed_at":"2023-02-08T16:35:12.142Z","dependency_job_id":null,"html_url":"https://github.com/melchisedech333/c-postgresql","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/melchisedech333/c-postgresql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchisedech333%2Fc-postgresql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchisedech333%2Fc-postgresql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchisedech333%2Fc-postgresql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchisedech333%2Fc-postgresql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melchisedech333","download_url":"https://codeload.github.com/melchisedech333/c-postgresql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melchisedech333%2Fc-postgresql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29547449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"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":["c","connector-library","cpp","cpp-sql","database-postgresql","postgre-sql","postgres","postgres-database","postgres-databases","postgres-db","postgres-sql","postgresql","postgresql-connector","postgresql-database","postgresql-databases","postgresql-driver","postgress","relational-database","relational-database-fundamentals","relational-databases"],"created_at":"2024-12-08T18:09:29.534Z","updated_at":"2026-02-17T14:33:55.456Z","avatar_url":"https://github.com/melchisedech333.png","language":"C","readme":"\n\u003cdiv align='center'\u003e\n\n\u003cimg src=\"images/banner.jpg\" \u003e\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/sponsors/melchisedech333\"\u003e\u003cimg src=\"https://img.shields.io/badge/patrocinar-30363D?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=#white\" \u003e\u003c/a\u003e\n    \u003cbr\u003e\u003cbr\u003e\n    \u003cimg src=\"https://badgen.net/badge/nível de amor/7 de 10/purple\" \u003e\n    \u003cimg src=\"https://img.shields.io/github/languages/count/melchisedech333/c-postgresql?color=%23f34b7d\u0026label=linguagens\" \u003e\n    \u003cimg src=\"https://img.shields.io/github/languages/top/melchisedech333/c-postgresql?color=%23f34b7d\" \u003e\n    \u003cimg src=\"https://img.shields.io/github/directory-file-count/melchisedech333/c-postgresql?label=arquivos\" \u003e\n    \u003cimg src=\"https://img.shields.io/github/repo-size/melchisedech333/c-postgresql?label=tamanho repo\" \u003e\n    \u003cimg src=\"https://img.shields.io/github/license/melchisedech333/c-postgresql?label=licen%C3%A7a\" \u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\nLanguage: \u003ca href=\"readme.md\"\u003eEN-US\u003c/a\u003e\n\n\u003cbr\u003e\n\nO propósito dos códigos deste repositório é fornecer um conjunto de exemplos de código para quem está começando a usar o PostgreSQL com a linguagem C.\n\n**Se meu código te ajudou em algo, considere [ser um patrocinador](https://github.com/sponsors/melchisedech333) :blue_heart:** \n\n\u003cbr\u003e\n\n\n:bookmark_tabs: Sumário\n-----\n* [Noções gerais](#star-Noções-gerais)\n* [Descrição dos arquivos](#clipboard-Descrição-dos-arquivos)\n* [Compilando os códigos](#hammer-Compilando-os-códigos)\n* [Referências e Links](#link-Referências-e-Links)\n* [Autor](#smiley-autor)\n* [Licença](#scroll-licença)\n-----\n\n\u003cbr\u003e\n\n:star: Noções gerais\n---\n\n\u003cbr\u003e\n\nPara instalar o PostgreSQL no Linux (distribuições baseadas em Debian/Ubuntu), você pode executar os comandos abaixo.\n\n```bash\nsudo apt install postgresql postgresql-contrib\nsudo apt install libpq-dev\n```\n\n\u003cbr\u003e\n\nConectar no servidor:\n```bash\nsudo -u postgres psql\n```\n\n\u003cbr\u003e\n\nAo acessar o servidor, você pode utilizar estes comandos abaixo para gerenciá-lo.\n\n```\n\\l                     Lista os bancos de dados.\n\\c DB_NAME             Conecta em um banco de dados existente.\n\\dt                    Lista as tabelas existentes.\n\\q                     Sair do servidor.\n```\n\n\u003cbr\u003e\n\n:clipboard: Descrição dos arquivos\n---\n\nDe uso geral:\n\n- \u003cb\u003ebuild.sh\u003c/b\u003e: Gera executáveis (compila).\n- \u003cb\u003esettings.h\u003c/b\u003e: Header contendo as configurações do servidor PostgreSQL.\n\n\u003cbr\u003e\n\nCódigos:\n\n- \u003cb\u003e1 - connect.c\u003c/b\u003e: Realiza a conexão com o servidor.\n- \u003cb\u003e2 - create table.c\u003c/b\u003e: Cria e exclui uma tabela no banco de dados.\n- \u003cb\u003e3 - insert item.c\u003c/b\u003e: Insere registros em uma tabela.\n- \u003cb\u003e4 - select all.c\u003c/b\u003e: Seleciona os registros de uma tabela.\n- \u003cb\u003e5 - delete.c\u003c/b\u003e: Exclui registros.\n- \u003cb\u003e6 - update.c\u003c/b\u003e: Atualiza registros.\n\n\u003cbr\u003e\n\n:hammer: Compilando os códigos\n---\n\nPara compilar os códigos, basta executar o script \u003cb\u003ebuild.sh\u003c/b\u003e, especificando em seus parâmetros o nome do arquivo que você deseja compilar, como no exemplo abaixo.\n\n```bash\n./build.sh \"1 - connect.c\"\n```\n\n\u003cbr\u003e\n\nO arquivo compilado sempre fica salvo com o nome \u003cb\u003eapp-test\u003c/b\u003e, logo, basta executá-lo para realizar os testes.\n\n```bash\n./app-test\n```\n\n\u003cbr\u003e\n\n:link: Referências e Links\n---\n\n[ZetCode, PostgreSQL programming in C](https://zetcode.com/db/postgresqlc/)\n\n\u003cbr\u003e\n\n:smiley: Autor\n---\n\nPatrocinar: [melchisedech333](https://github.com/sponsors/melchisedech333)\u003cbr\u003e\nTwitter: [Melchisedech333](https://twitter.com/Melchisedech333)\u003cbr\u003e\nLinkedIn: [Melchisedech Rex](https://www.linkedin.com/in/melchisedech-rex-724152235/)\u003cbr\u003e\nBlog: [melchisedech333.github.io](https://melchisedech333.github.io/)\u003cbr\u003e\n\n\u003ca href=\"https://github.com/melchisedech333\" \u003e\u003cimg src=\"https://github.com/melchisedech333.png?size=200\" height=\"100\" /\u003e\u003c/a\u003e\n\n\u003cbr\u003e\n\n:scroll: Licença\n---\n\n[BSD-3-Clause license](./license)\n\n\u003cbr\u003e\u003cbr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n## Lembre-se de deixar \u003cbr\u003e uma linda estrelinha :star_struck:\n\n\u003c/div\u003e\n\n\n","funding_links":["https://github.com/sponsors/melchisedech333"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelchisedech333%2Fc-postgresql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelchisedech333%2Fc-postgresql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelchisedech333%2Fc-postgresql/lists"}