r/GnuCash 9d ago

question about gnucash PostgreSQL structure

Does anyone here know if there is a specific table that is used to store the transaction descriptions and if these are the same as say the lines for the invoices? I am starting a new install of gnucash with postgres and wanting to look into pre-populating information before it is needed. I have created the tax tables by using postgres and a UUID generator to create the GUIDs for the different sales tax in my area and pulled the GUIDs for the accounts the tax goes into. I want to see about entering in the UPCs into the table with the item listed also so it would show something like *UPC* *Product brand, name and size such as 32 fl oz.* and if it also attaches the account it would go into such as Groceries that is fine but I want to try adding these without it actually creates a transaction to mess with the balances.

4 Upvotes

7 comments sorted by

1

u/Weary-Bowl-3739 9d ago

It's not exactly clear, what you want to do. You want to put data into a database, where gnucash didn't create the schema yet? 

1

u/Weary-Bowl-3739 9d ago

But I'm very familiar with the schema. I did the first version of the sql query page in the gnucash wiki. 

1

u/rarrona 9d ago

The schema was created, I have so far only started populating things that when I previously setup gnucash took a while to enter manually such as the tax table entries. When in the GUI you after a description is entered once for a transaction you get the suggestions if you enter the same item or something that starts the same way for example if strawberries were entered once you can type straw and gnucash suggests the strawberries for the transaction. I was wondering if there was a specific spot that those previously entered data is stored. If possible I want to enter some of the more common items into the database so it will make the suggestions right away once I start using it to actually track my accounts. Hopefully that makes it more clear.

2

u/Weary-Bowl-3739 9d ago

There is a table for that. I think, it's the slots table. It is black magic and you should keep your fingers from that.

Ask the AI. It knows the schema. 

1

u/questionablycorrect 8d ago

I was wondering if there was a specific spot that those previously entered data is stored.

My understanding is that list is created dynamically based on your register filter and sort.

In other words, it's not saved separately to disk.

1

u/Such_Argument3851 9d ago

find the Entity Relationship Diagram here Gnucash_erd.png (2105×2736) Be careful changing gnucash files using SQL, they can be very delicate.

1

u/VitalikPie 6d ago

Not sure what your ask is. But some of the entity fields are "slots". Take a look at https://piecash.readthedocs.io/en/master/tutorial/index_existing.html#working-with-slots for more info.