On Wed, Oct 8, 2014 at 12:44 PM, Michael Van Canneyt <[email protected] > wrote: > > On Wed, 8 Oct 2014, silvioprog wrote > >> Hello, >> >> I need to create a PostgreSQL database from my application. The >> TPQConnection.CreateDB works fine, but I need to configure some properties >> of my >> database in your creation. >> >> In pgAdmin, I execute: >> >> CREATE DATABASE myuser >> WITH ENCODING='UTF8' >> OWNER=myowner >> TEMPLATE=template1 >> LC_CTYPE='Portuguese_Brazil.1252' >> CONNECTION LIMIT=-1 >> TABLESPACE=pg_default; >> >> But, how to create a database with TPQConnection passing the ENCODING, >> OWNER, TEMPLATE, LC_CTYPE and TABLESPACE properties? >> > > Try setting them as 'Name=Value' pairs in the Params property of the > connection component. > > Michael.
Hello buddy, sorry for my long delay. Thanks for the great tip, I tried it too, but unfortunately the postgre rejected that talking something like "unrecognized param for this operation". Today I fixed that using a "mix of codes": creating the database using the original postgre driver for Java, and calling "java -jar create_mydb <params>" via TProcess. Now it worked like a charm! Thank a lot! -- Silvio Clécio My public projects - github.com/silvioprog
-- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
