On Sunday 19 June 2005 15:23, Dan Langille wrote:
> On 19 Jun 2005 at 11:01, Kern Sibbald wrote:
> > On Saturday 18 June 2005 22:46, Dan Langille wrote:
> > > Hi folks,
> > >
> > > I pretty much have bacula-web working using PostgreSQL.  You can see
> > > what I have at http://www.langille.org/tmp/bacula-web/
> > >
> > > Included there are screen shots and the diff.  Please compare my
> > > screen shots with what you see on your MySQL websites and point out
> > > anything that is missing.  Perhaps I've not tried a link or a window
> > > somewhere.
> > >
> > > Most of the problems have been:
> > >
> > > - SQL specific to MySQL (e.g. functions names).  That said, the SQL
> > > now in use is not standard either (e.g. INTERVAL is not standard
> > > AFAIK).
> > >
> > > - case specific columns.  The column names returned by MySQL and
> > > PostgreSQL differ.  The result is that $row['JobId'] is not the same
> > > as $row['jobid'].
> >
> > Is this last point something that can be fixed by changing the table
> > creation in PostgreSQL to use upper and lower case table names and row
> > names as we do in MySQL?
>
> That can be done, but I advise against it.  We don't do that for
> Bacula proper.  If you use mixed case, and want it preserved, you
> must always use it:
>
> test=# create table "Testing" (ColOne int, "ColTwo" int);
> CREATE TABLE
> test=# \dt
>               List of relations
>  Schema |        Name        | Type  | Owner
> --------+--------------------+-------+-------
>  public | Testing            | table | dan
>  public | activity           | table | dan
>  public | eric               | table | dan
>  public | filename           | table | dan
>  public | test               | table | dan
>  public | watch_list_element | table | dan
> (6 rows)
>
> test=# select * from testing;
> ERROR:  relation "testing" does not exist
> test=# select * from Testing;
> ERROR:  relation "testing" does not exist
> test=# select * from "Testing";
>  colone | ColTwo
> --------+--------
> (0 rows)

There is something that I don't understand here.  

Bacula uses table definitions and SQL with upper and lower case characters, 
and PostgreSQL seems to work just fine, providing there are no quotes around 
any of the names, either in the definition of the table or in the SQL.  

What I don't particularly like is that it always returns lower case characters 
for the column names.  I suppose this is the SQL standard, but it sure makes 
it harder for the programmer ...


>
> test=# select colone from "Testing";
>  colone
> --------
> (0 rows)
>
> test=# select coltwo from "Testing";
> ERROR:  column "coltwo" does not exist
> test=# select ColTwo from "Testing";
> ERROR:  column "coltwo" does not exist
> test=# select "ColTwo" from "Testing";
>  ColTwo
> --------
> (0 rows)
>
> test=#
>
> > Doing so would certainly make the output look a lot more asthetic both
> > in bacula-web and in Bacula output.
>
> Why do you think that would improve the output?

because column names in upper lower case in reports are much more asthetic 
(imo). take any report that bacula-web produces and change the upper case 
characters into lower case, and the report will take on a bizarre look.  it 
is like removing all capitialization from english. i guess you get the idea. 

Not every column in every report contains a column name from the database, but 
this is often the case -- much more in Bacula than in bacula-web.  An example 
is the the Bacula list command. The MySQL and SQLite output looks much more 
"professional" and esthetic than the PostgreSQL (at least IMO).

It is not a big problem because Juan Luis "solved" this by using the AS clause 
to rename the columns with upper/lower case characters.  

-- 
Best regards,

Kern

  (">
  /\
  V_V


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to