[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class PostgresChatMessageHistory (0.14.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.14.1 (latest)](/python/docs/reference/langchain-google-cloud-sql-pg/latest/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.14.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.14.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.13.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.13.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.12.1](/python/docs/reference/langchain-google-cloud-sql-pg/0.12.1/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.11.1](/python/docs/reference/langchain-google-cloud-sql-pg/0.11.1/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.10.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.10.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.9.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.9.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.8.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.8.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.7.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.7.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.6.1](/python/docs/reference/langchain-google-cloud-sql-pg/0.6.1/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.5.0](/python/docs/reference/langchain-google-cloud-sql-pg/0.5.0/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory)\n- [0.4.1](/python/docs/reference/langchain-google-cloud-sql-pg/0.4.1/langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory) \n\n PostgresChatMessageHistory(\n key: object,\n engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,\n history: langchain_google_cloud_sql_pg.async_chat_message_history.AsyncPostgresChatMessageHistory,\n )\n\nChat message history stored in an Cloud SQL for PostgreSQL database.\n\nProperties\n----------\n\n### messages\n\nFetches all messages stored in AlloyDB.\n\nMethods\n-------\n\n### PostgresChatMessageHistory\n\n PostgresChatMessageHistory(\n key: object,\n engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,\n history: langchain_google_cloud_sql_pg.async_chat_message_history.AsyncPostgresChatMessageHistory,\n )\n\nPostgresChatMessageHistory constructor.\n\n### aadd_message\n\n aadd_message(message: langchain_core.messages.base.BaseMessage) -\u003e None\n\nAppend the message to the record in PostgreSQL\n\n### aadd_messages\n\n aadd_messages(\n messages: typing.Sequence[langchain_core.messages.base.BaseMessage],\n ) -\u003e None\n\nAppend a list of messages to the record in PostgreSQL\n\n### aclear\n\n aclear() -\u003e None\n\nClear session memory from PostgreSQL\n\n### add_message\n\n add_message(message: langchain_core.messages.base.BaseMessage) -\u003e None\n\nAppend the message to the record in PostgreSQL\n\n### add_messages\n\n add_messages(\n messages: typing.Sequence[langchain_core.messages.base.BaseMessage],\n ) -\u003e None\n\nAppend a list of messages to the record in PostgreSQL\n\n### clear\n\n clear() -\u003e None\n\nClear session memory from PostgreSQL\n\n### create\n\n create(\n engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,\n session_id: str,\n table_name: str,\n schema_name: str = \"public\",\n ) -\u003e langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory\n\nCreate a new PostgresChatMessageHistory instance.\n\n### create_sync\n\n create_sync(\n engine: langchain_google_cloud_sql_pg.engine.PostgresEngine,\n session_id: str,\n table_name: str,\n schema_name: str = \"public\",\n ) -\u003e langchain_google_cloud_sql_pg.chat_message_history.PostgresChatMessageHistory\n\nCreate a new PostgresChatMessageHistory instance."]]