Postgresql
Bastiaan Olij
bastiaan at basenlily.me
Sat Aug 2 10:20:51 EDT 2014
Hi Daniel,
When you installed the postgres server software you installed a single
server. pgAdmin simply is a tool that allows you to administer this
server or any other server you had already installed previously. pgAdmin
can't create new servers, you can only specify where it can find another
existing server presumably installed on another computer in your network.
pgAdmin in that way is nothing more then a client application just like
your Omnis Studio application.
Within a single server you can create multiple databases. Compare a
database to your datafile in old Omnis terms but it is fully maintained
by your server. You'll probably just want to create a single database
for your application and stick with that. Unless your building something
really serious you'll likely not need more then one database for every
application you build and I definitely wouldn't worry about it if you're
just starting.
Forget about tablespaces. Tablespaces are simply constructs within
Postgres that tell Postgres where data is physically located on disk.
Postgres has a default tablespace that points to your data folder within
your Postgres installation into which all data is placed. Chances are
that will suit you just fine for the rest of your postgres days.
The database contains all your table definitions and the data held
within those tables. One of the trickiest things to get your head around
here is that unlike the datafile it is disjointed from Omnis. With
datafile when you create a file class you miraculously also create the
table within your datafile and you can work with it. When you change
your file class miraculously your datafile changes with it. Your library
and your datafile are linked and act as a unit. With Postgres (and any
other SQL platform) you have no such luxury. Your client application and
the SQL server are two separate entities and it is up to you the
developer to make them work together.
When you create a table using pgAdmin and define which columns exist as
part of that table Postgres is fully set up to store data into that
table but Omnis is non the wiser.
Schema classes and table classes are Omnis constructs that allow you to
interact with the tables held within Postgres without needing to know
too much about SQL itself. Once you have created a table within Postgres
you will need to create a schema within Omnis that matches your table
definition. Luckily you can use the SQL browser to do this by dragging
your table into your library and Omnis will create this schema for you.
You can also do this the other way around, create a schema class and
drag it into your database using the SQL browser and Omnis will create
the table for you.
You have to realize though that Omnis does not come with standard logic
to push out any changes you made. You can't later on add columns to your
schema class and then make those columns magically be added on Postgres.
That is code you will have to write yourself.
Cheers,
Bastiaan Olij
On 2/08/14 11:36 PM, Daniel Sananes wrote:
> Hi all,
>
> I am starting to use Postgresql with studio and there are things I do not
> understand.
> I open pgAdmin and read the help a bit but I get confused immediately.
> In the tree-structure there is a Server Groups and 1 Servers beneath and
> then a Postgresql 9.3(localhost:5432).
> If I doubleclick on Postgresql a window appear where I am supposed to enter
> password, which I do (remembering I entered this when installing
> Postgresql).
> Now Databases(1), Tablespaces, Group Roles and Login Roles appear.
> Under Databases(1)-tree is postgres, if I click on postgres Catalogs, Event
> Triggers, Extensions, Schemas and Slony Replication shows in the tree.
>
> Right-Clicking on postgres from this tree gives a menu with New Object - New
> database.
> If I click on New database, is this the database where I put my
> "fileformats", or as I think my Tables/Schemas?
>
> There is also under Databases(1) when right-clicking the menu-choice New
> Database.
> Which one is my database?
>
> Also, Servers ? Can I have several servers? Right-clicking here reveals
> nothing.
>
> So how is it, Omnis Studio connects to Postgresql what? The server i
> suppose? But if I have several databases do I connect to this one server who
> takes care of all databases I have created.
>
> What is tablespace?
>
> Sorry about my stupidity. But I find this Studio and Postgresql exremely
> challenging and fun.
>
> regards
> DanielDaniel
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>
>
--
Kindest Regards,
Bastiaan Olij
e-mail: bastiaan at basenlily.me
web: http://www.basenlily.me
Skype: Mux213
http://www.linkedin.com/in/bastiaanolij
More information about the omnisdev-en
mailing list