{"id":15528496,"url":"https://github.com/tomwojcik/is_valid_postgres_column_name","last_synced_at":"2026-04-29T04:38:43.110Z","repository":{"id":62571887,"uuid":"366421519","full_name":"tomwojcik/is_valid_postgres_column_name","owner":"tomwojcik","description":"Allows you to check if a given string can be a PostgreSQL column name.","archived":false,"fork":false,"pushed_at":"2021-05-12T15:29:56.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-22T23:07:40.837Z","etag":null,"topics":["postgresql","psycopg","psycopg2"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tomwojcik.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}},"created_at":"2021-05-11T15:00:12.000Z","updated_at":"2022-05-20T14:55:49.000Z","dependencies_parsed_at":"2022-11-03T16:31:41.641Z","dependency_job_id":null,"html_url":"https://github.com/tomwojcik/is_valid_postgres_column_name","commit_stats":null,"previous_names":["tomwojcik/is_valid_postgres_column"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tomwojcik/is_valid_postgres_column_name","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwojcik%2Fis_valid_postgres_column_name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwojcik%2Fis_valid_postgres_column_name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwojcik%2Fis_valid_postgres_column_name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwojcik%2Fis_valid_postgres_column_name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomwojcik","download_url":"https://codeload.github.com/tomwojcik/is_valid_postgres_column_name/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomwojcik%2Fis_valid_postgres_column_name/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261518985,"owners_count":23171227,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["postgresql","psycopg","psycopg2"],"created_at":"2024-10-02T11:14:00.828Z","updated_at":"2026-04-29T04:38:38.080Z","avatar_url":"https://github.com/tomwojcik.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test Suite](https://github.com/tomwojcik/is_valid_postgres_column/actions/workflows/test-suite.yml/badge.svg)](https://github.com/tomwojcik/is_valid_postgres_column/actions/workflows/test-suite.yml)\n[![Python](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/python-370/)\n[![PyPI version](https://badge.fury.io/py/is-valid-postgres-column-name.svg)](https://badge.fury.io/py/is-valid-postgres-column-name)\n\n\nI found it weird there's no simple way to check if a given string can be a PostgreSQL column name.\nAlthough, to my understanding, you can escape with quotation marks some names that are otherwise invalid,\nI don't think escaping such a thing is a good idea.\n\nThis validation is required if your column name can be dynamically generated.\n\n# How to use\n\n```python\n\u003e\u003e\u003e from is_valid_postgres_column_name import is_valid_postgres_column_name\n\u003e\u003e\u003e is_valid_postgres_column_name(\"column_A\")\nTrue\n\u003e\u003e\u003e is_valid_postgres_column_name(\"1column_A\")\nFalse\n```\n\nAll PostgreSQL versions are supported. The only difference between versions, to my knowledge, are reserved keywords.\n```python\n\u003e\u003e\u003e is_valid_postgres_column_name(\"window\", version=13)\nFalse\n\u003e\u003e\u003e is_valid_postgres_column_name(\"window\", version=7.1)\nTrue\n```\n\n# Installation\n\n```shell\n$ pip install -U is_valid_postgres_column_name\n```\n\n# Requirements\n\nPython 3.0+\n\n# Dependencies\n\nNone.\n\n# Contribution\n\nWelcome.\n\n# Alternatives\n\nIf you don't want to download additional library for such a simple thing, have a look at `sqlparse` [`keywords.py`](https://github.com/andialbrecht/sqlparse/blob/23d29933ddc4272b495d36e0e32d3eaf0c3ef76d/sqlparse/keywords.py) file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomwojcik%2Fis_valid_postgres_column_name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomwojcik%2Fis_valid_postgres_column_name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomwojcik%2Fis_valid_postgres_column_name/lists"}