Tag Info

New answers tagged

0

If you are just trying to simulate a timeout on your application side you could just use a dummy query like: SELECT pg_sleep(seconds); Where seconds is some integer value that would simulate a query just not coming back in a reasonable timeframe. If you want to never come back from a query just run the above and kill the database. pgrep posgres | xargs ...


0

How are you simulating the successful queries? You should be able to use the same mechanism, but return PGRES_FATAL_ERROR (and appropriate message strings) in your PGresult return value .


1

GDBM databases are readable through the GDBM API. I wrote an small article about it last year. They are basically a way to store simple key-value pairs of any kind. There is no "structure" as in traditional DBMSes : no tables, no columns... Only keys and values. The API defines the following functions: GDBM_FILE gdbm_open (const char *name, int block_size, ...


1

The most easy way is probably writing an improvised tool in a bit more powerful scripting language. I've just written one in Ruby's GDBM (no error handling): #!/usr/bin/ruby require 'gdbm' dbfile, op, key, val, = ARGV GDBM.open(dbfile) do |db| case op when "set" db[key] = val when "get" puts db[key] when "rm" db.delete(key) else ...


1

Yes, vacation does use Berkeley DB for the purpose you described. Indeed, you could run into problems if you try and access the same Berkeley DB files using different versions of the client libraries. The on-disk format does change from time to time and upgrading is normally handled transparently by the client application (or manually, using the db_upgrade ...


0

Sure, but this kind of thing is a bit easier to do if you plan a bit up front. Changes When you create a database migration (think schema change) you need to create a sql statement that will encapsulate the change. If you are adding a column to an existing table with data in it you should be able to create the sql statement that describes the change. For ...



Top 50 recent answers are included