Child pages
  • PostgreSQL Primer

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PostgreSQL doesn't do automatic casting of types. This means that when sending in parameters into a prepared statement, it is up to the developer to make sure to send in the right type.

For example:

Code Block

                var value = 1;
		var query = 'SELECT * FROM table WHERE textcolumn = ?'
		var args = new Array();
		args[0] = value;
		var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, args, maxReturnedRows);

Now has to become:

Code Block

                var value = 1;
		var query = 'SELECT * FROM table WHERE textcolumn = ?'
		var args = new Array();
		args[0] = value + ""; //forcing the integer value to become a string
		var dataset = databaseManager.getDataSetByQuery(controller.getServerName(), query, args, maxReturnedRows);

...

A good starting point to data migration towards PostgreSQL is the [PostgreSQL wiki|http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL]the PostgreSQL wiki, which has a lot of tutorials migrating data into postgreSQL from many different source databases.

...

When the amount of data to be moved to the new database is massive or required pre-processing, a better solution is to dump the data to a generic format and import it directly into the new database.Another option is to use the Servoy Sybase > PostgreSQL Migration Service from PgExperts: they offer services related to PostgreSQL and are also heavily involved in the PostgreSQL open source community.

When migrating from Sybase to PostgreSQL, PgExperts provides a special migration service for Servoy customers. For more information on this service check the Pgexperts website

PostgreSQL documentation

PostgreSQL has excellent documentation, which can be found here. Note that Servoy 5.2.x ships with PostgreSQL 8.4.