2.3, Postgres backend and GUIDs

Mark Johnson mrj001 at shaw.ca
Tue Oct 13 21:06:12 EDT 2009


For scripting, there is the command line 'uuidgen'.  On my Slackware 
system, it is in e2fsprogs.

PostgreSql version 8.3 added the UUID data type.  From section 8.12 of 
that manual:

    "PostgreSQL provides storage and comparison functions for UUIDs, but
    the core database does not include any function for generating
    UUIDs, because no single algorithm is well suited for every
    application. The contrib module contrib/uuid-ossp provides functions
    that implement several standard algorithms. Alternatively, UUIDs
    could be generated by client applications or other libraries invoked
    through a server-side function."

Hope that helps,
Mark

Eric Ladner wrote:
> Anybody know if there's a way to generate GUIDs via SQL in Postgres?
>
> Looking at a script that can load historical data into the prices
> table, but can't find an easy way to generate GUIDs required for the
> primary key.
>
>   


More information about the gnucash-user mailing list