Sunday, April 28, 2013

[how to] SSRS Reports Design Standards and Guidelines Document

[how to] SSRS Reports Design Standards and Guidelines Document


SSRS Reports Design Standards and Guidelines Document

Posted: 28 Apr 2013 05:59 PM PDT

We've just started to create reports for out under developed application using SSRS. To make the layouts, formats, namings, etc consistent across all reports, we should create a Reports design standards and guidelines document. I'm wondering if your in your organisation have such a document that we can use as the baseline, instead of reinventing the wheel?

Thanks in advance.

checking number of occupied occupied neighbours

Posted: 28 Apr 2013 03:13 PM PDT

Assuming a pixel grid with x and y of the size 1000 over 1000. In each iteration\run, using a random number generator, certain cells will be marked as occupied. Those cells will be written in a SQLite database.

In a two dimentional grid, each cell can have up to 8 occupied neighbours. Once an occupied cell sees 8 occupied neighbours i would like to preform some computations.

At the moment i have in my SQLite table three columns (x and y, processed). Only occupied cells are written in to the table (unoccupied cells are not in the table). The processed flag is a boolean flag.

I would like to know after each run, if there exist cells which are occupied, not processed and have 8 occupied neighbours. I am open to changes in the database for doing this query.

Referencing a Join table

Posted: 28 Apr 2013 03:45 PM PDT

I have a relationship that I am trying to represent in a database. Imagine I have series of many to many relationships...

Say student to proffesor, and professor to classes...enter image description here

A student can many professors and professors can obviously have many students. A student also has many classes, each taught by a different or similar professor, and professors can teach many classes.

To relate those many to many relationships to each other, you obviously need a join table between each.

But, if you relate a student to a professor, you are automatically linking him to all the classes that he teaches. Which doesn't necessarily have to be the case. You could take one class with one professor, and have another class with another professor, or you could have two classes with one professor and another with another professor.

Obviously you could just link the student directly to the classes and then link the professors to the classes. But Imagine, for the sake of this question, that for some reason, you can only link students to classes. Imagine this is a legacy database for instance.

Would it be good form to instead of linking directly to the professor, link instead a link-table of the professor... So I would have a link table to a link table of say Prof ID 2, class ID 3... That would have a link id of lets say 2. I would then have a link table with student 3 linked to Prof->Class ID 3. So that student is now linked to professor ID 2 and class ID 3. Think of that relationship like this...

enter image description here

Is that a good way to represent that relationship, or is there a better way to do this?

Storing no of players the last seven days in an online game

Posted: 28 Apr 2013 11:13 AM PDT

I want to plot the number of players, in the last seven days, of an MMORPG which haves 50~ servers. The system fetches the number of players in each server every 15 minutes and I'm not really sure how to store and update this information in an efficient way.

The easiest (but probably not so efficient) way I can think of is just having three columns, "time_fetched", "server", "no_players". Every 15 minutes it inserts 50 new rows and deletes the 50 oldest rows.

Maybe I could store weekday, hours and minute instead? So instead of deleting and inserting rows it just updates the correct rows? This would mean that I always have a fixed number of rows in the table (50 * 4 * 24 * 7 = 33600).

Also; would it be more efficient to store the server name as an enum instead of just strings (or some other way, maybe one table for each server)?

Unable to connect to SQL server 2008 R2 via Instance name?

Posted: 28 Apr 2013 11:15 AM PDT

I don't understand :

I've installed sql server 2008 R2. the installation process asked me for the desired instance name , so I wrote: MSSQLSERVER.

after the installation , running Setup Discovery Report does shows me the instance name :

enter image description here

I've also installed all the service packs.

Also , all the services are up :

enter image description here

Also , all the ports are open ( tcp:1433 + udp :1434)

enter image description here

enter image description here

Also , Named pipes are on : enter image description here

So , where is the problem ?

I'm unable to connect via the instance name : enter image description here

Also unable with :

user\MSSQLSERVER where user is the computer name.

Also unable with : .\MSSQLSERVER

But (weird) :

Those 3 do work :

  • user ( "user" is my machine name)
  • (local)
  • .

Question :

why I can't use my instance name to connect to my sql server ?

Related info :

After connecting via one of the 3 who work , I run a helpful info :

enter image description here

How to use CREATE TABLE ... AS with Primary Key in SQLite

Posted: 28 Apr 2013 06:51 AM PDT

From SQLite documentation for CREATE TABLE http://www.sqlite.org/lang_createtable.html:

A table created using CREATE TABLE AS has no PRIMARY KEY and no constraints of any kind.

So is there any general way to create table with primary key & other index information ?

From SQL Server to NuoDB: Common Table Expressions, Stored Procedures and Bulk Uploads

Posted: 28 Apr 2013 01:32 PM PDT

I am currently evaluating NuoDB as a replacement for SQL Server. The application is written in C#, .NET 4.0.

Now I am using features of SQL Server like:

  • Common Table Expressions (I have a table with a reference to itself composing a n-level parent-chilren hierarchy)
  • Stored Procedures
  • Bulk Uploads

I didn't find enough reference on NuoDB to understand if it is suitable to do these things:

  • Large select operations with hierarchy logics (now I use a recursive CTE on the 'items' table to accomplish this)
  • Complex updates/inserts thru some kind of algorithm (stored procs would be ok)
  • Bulk insert/update of 100.000+ elements (I am using bulk upload feature of SQL Server .NET client and it works ok)

Besides this, I am also interested in partitioning, anybody has some experience in partitioning with NuoDB?

Thanks

Oracle 11g delete by unique key slow

Posted: 28 Apr 2013 06:04 AM PDT

We have been plagued by a deadlock issue for quite some time that relates to deletes and inserts on the same table. It happens sporadically, but had been increasing in frequency. It would manifest itself as a DELETE FROM MYTABLE by unique ID statement BLOCKING INSERT INTO MYTABLE statements.

Initially, we could not see the bind variables because we were using Hibernate and we could not turn on show_sql for Hibernate since there is far too much traffic on other Hibernate-managed POJOs in other areas of the application. We had thought Hibernate might be doing something with its cache at unexpected times.

Recently, I removed Hibernate for the table in question, replaced it with JDBC, and log EVERY touch (every SELECT/INSERT/UPDATE/DELETE) against that table.

After doing that, I've only seen 1 "blocker". So I don't know if the problem is fixed by virtue of removing Hibernate and doing everything via JDBC. However, I would be remiss if I didn't attempt to run down that blocker instance.

Here's what I see:

  • A DELETE FROM MYTABLE by unique ID took almost 10 seconds at one point.
  • There are no other "touches" on MYTABLE for that Unique ID on or around the time of the DELETE FROM MYTABLE by Unique ID.
  • That DELETE blocked other INSERT INTO statements.
  • The "blocker" Delete statement completed in 10 seconds and cleared itself, and after that, everything was fine.
  • It only happened once, the rest of the day DELETE FROM MYTABLE by Unique ID would complete sub-second, as one would expect.

I verified with our DBAs that:

  1. We do not have any on delete triggers on the table in question.
  2. All FKs in that table are indexed.

Does anyone have any insight/recommendations on what might cause a Delete statement by Unique ID to possibly take 10 seconds, when there is no other touches on that table for that row (no select, update, or insert by that Unique ID)?

I realize that there probably isn't a precise and exact answer to this questions, I'm just hoping someone can share insight or anecdotal information on their own experiences.

Thank you sincerely in advance.

Database mirroring - worked once?

Posted: 28 Apr 2013 01:34 PM PDT

I setup SQL Server 2012 Standard on 2 different servers and installed SQL Server 2012 Express on a Witness server. All 3 servers are running Server Enterprise 2008 R2.

I'm using these instructions: http://blogs.msdn.com/b/suhde/archive/2009/07/13/step-by-step-guide-to-configure-database-mirroring-between-sql-server-instances-in-a-workgroup.aspx

Everything connected perfectly.

I disabled the NIC in the principal server, verified the mirror server had become the principal and was able to access the application! Success!

That was the only time it worked. Now, when I disable the Principal server I get a timeout for our .NET application.

  • In SQL Server Management Studio it shows that the switch was made from Mirror to Principal so that is working correctly.

  • As soon as I re-enable the NIC on the Principal server the application comes up fine.

  • We have extended the timeout per the knowledge base article - but that doesn't help. http://support.microsoft.com/kb/2605597

  • I even rebuilt the Witness Server from scratch. Once again, the fail over worked once, but then stopped working.

  • All Windows Firewalls are turned off

  • All ports are completely open on the firewall between the Witness, Application Server, and SQL Servers

Ideas/Thoughts?

get rank in marks database in mysql

Posted: 28 Apr 2013 07:04 PM PDT

I have a Student database having one table EXAM.

id    1  2  3  4  5  marks 7 10  7 10  9         

Question is how to give rank like

+------+  | rank |  +------+  |    3 |  |    1 |  |    3 |  |    1 |  |    2 |  +------+  

I have used a Query:-

SELECT id, marks, FIND_IN_SET( marks, (  SELECT GROUP_CONCAT( marks  ORDER BY marks DESC )   FROM exam )  ) AS rank  FROM exam;  

but it gives rank

+------+  | rank |  +------+  |    4 |  |    1 |  |    4 |  |    1 |  |    3 |  +------+  

What should I do??

How to migrate SQL Server to MySQL

Posted: 28 Apr 2013 04:40 PM PDT

I'm trying to migrate a SQL Server db to MySQL, and I'm having a tough time. I've tried:

  • MySQLWorkbench -- migration tool fails because my login only shows views in SQL Server, not the tables themselves, and so I can't get past the "Schemata Selection" screen.

  • sqlcmd and bcp -- both fail because they can't export csv properly. They don't quote strings with commas in them. Plus, they don't create table schemas in MySQL.

  • SQLyog -- just fails. Creates a MySQL table from a MS SQL view ok, but doesn't import the data. Also takes a really long time on small tables, and I have to import millions of rows.

Anyone have suggestions?

sql server-percentage calculation

Posted: 28 Apr 2013 07:04 AM PDT

Sample data :

LINE_NO E_FIELD F_FIELD G_FIELD HSA_STATUS  FAMILY  CACHE_FAMILY    Count  23053B  00000   00000   00000   S           SUMMIT      WER           43  23053B  00000   00000   00000   T           SUMMIT      WER           144  23053B  00000   00000   00684   T           SUMMIT      WER           2  23053B  00353   00418   00684   T           SUMMIT      WER           1  23053B  00353   00418   00763   T           SUMMIT      WER           1  23053B  00353   00418   01512   T           SUMMIT      WER           1  23053B  00353   00418   06797   T           SUMMIT      WER           1  23053B  00353   00418   30228   T           SUMMIT      WER           1  23053B  00353   00418   31935   T           SUMMIT      WER           2  23053B  05601   01402   00758   T           SUMMIT      WER           1  23053B  05601   01402   09091   T           SUMMIT      WER           1  23053B  05601   01402   65053   T           SUMMIT      WER           1  

This is my query:

SELECT LINE_NO,    E_FIELD,    F_FIELD,    G_FIELD,    HSA_STATUS,    FAMILY,    CACHE_FAMILY,    Count = ((SUM(TOTAL)) )    FROM  (    SELECT LINE_NO,      E_FIELD,      F_FIELD,G_FIELD,      HSA_STATUS,      FAMILY,      CACHE_FAMILY,       Count(LINE_NO) as Total     FROM TX_HSA_SUMM     WHERE MT_TIMESTAMP2 BETWEEN ('2013-03-07 10:10:00') AND ('2013-03-08 10:20:00')     GROUP BY LINE_NO,E_FIELD,F_FIELD,G_FIELD,HSA_STATUS,FAMILY,CACHE_FAMILY  ) as a  GROUP BY LINE_NO,E_FIELD,F_FIELD,G_FIELD,HSA_STATUS,FAMILY,CACHE_FAMILY,total  ORDER BY LINE_NO,E_FIELD,F_FIELD,G_FIELD,HSA_STATUS,FAMILY,CACHE_FAMILY,total  

This is my sample data actually. I already make the count. As You can see the column header. My problem is I need to sum the count and the for each row I need to get the percentage. For example the total for the above record is 199 so for the first record count is 43 so the calculation should be 43/199 * 100. How can I view the percentage? Please help me I need this urgently.

Mysql. Block/disconnect slow queries

Posted: 28 Apr 2013 03:04 AM PDT

I am experiencing issue.

Someone 'attacked' my server: simply by searching the same phrase with multiple requests.

As it is text search request and database indices are not used, the engine searches through every row. In general I will deal with myisam full-text indices, but I am curious, is there any way to block/disconnect/interrupt the query which is longer than x seconds?

P.S. I have wait_timeout set to 30, is there anything else I can set(I don't think interactive timeout will be useful).

How to refresh AD security group on Sql Server permissions

Posted: 28 Apr 2013 02:23 AM PDT

I am using Sql Server 2008 on Small Business Server 2003; client is using WinXP.

I added a user to my Active Directory Security Group; Why can't this user immediately access the database? It seems there is a delay before the user is recognized in Sql Server.

I am using AD Security Groups for permissions expressly so that I don't need to add individual users in Sql Server. So effectively I don't need to do anything but add the user to the AD Security Group in order to grant access.

But for some reason Sql Server doesn't immediately recognize the addition. I've seen this a number of times. I add the user to the group but that user can't access data until the next day. It seems that it doesn't query the Active Directory in real time. Can you confirm that is so?

What do I need to do so that Sql Server "refreshes" the list of users from Active Directory?

multi-master to single-slave replication at table level with PostgreSQL or MySQL

Posted: 28 Apr 2013 10:04 AM PDT

Here is my scenario

Master1 hosting DB1  Master2 hosting DB2  ...  MasterN hosting DBN    replicate to:    Slave1 hosting DB1,DB2... DBN  

I've read similar questions and they recommend to start different instances at Slave1 and simply do MasterN-Slave1(instanceN) replication, as instructed here:

Single slave - multiple master MySQL replication

That would be piece of cake, but running different instances might be a waste of resources.

I really want to achieve this with an single DBMS instance at Slave1, and if possible with PostgreSQL; but can try with MySQL if there is a solution for this.

Any help is appreciated.

Invalid File Name on login to SQLPLUS

Posted: 28 Apr 2013 06:04 AM PDT

The moment I log into SQLPLUS I get an SP2-0556 error. I recently moved OS but am connecting to the same database so I am not sure if it's because I'm using my old TNSNames or what. I can connect and work normally but a few issues have arisen with running SQL scripts due to this where they then say Invalid File Name.

Any help would be greatly appreciated, thanks.

  • the database is 11g,
  • the command I use for running scripts is a custom ant script that basically loops through and runs normal .sql scripts,
  • and I changed from a Ubuntu system to Mac OS X.

The issues are that any new scripts I create (that I know work) give a Invalid File Name error then stop.

SQL server enterprise vs standard

Posted: 28 Apr 2013 05:12 PM PDT

I am studying the difference between SQL server enterprise and standard. The one feature that I find beneficial from this page is:

http://www.microsoft.com/sqlserver/en/us/editions.aspx

Advanced High Availability (Multiple, Active Secondaries; Multi-site, Geo-Clustering)

How exactly does it ensure advanced high availability? Does anybody have any details?

SQL Server account delegation setup

Posted: 28 Apr 2013 07:00 AM PDT

I am try to run bulk insert command on SQL Server 2008 but I am having issues with the security. after researching via internet, the problem has something to do with account delegation and impersonation.

However all solutions seems to point to an Active Directory setup which my setup is not.

My setup is SQL Server 2008 Express on Windows Server 2008 Standard configured as a workgroup.

Despite a SQL Server user account, assigned all the user mappings and server roles and ensuring security set to SQL, I am getting this error:

Msg 4861, Level 16, State 1, Line 1
Cannot bulk load because the file "\server_name\file_name.txt" could not be opened. Operating system error code 5 (Access is denied.).

So, how does one setup SQL Server account delegation and impersonation on a workgroup environment?

Thanks in advance

Trouble setting up Nagios to monitor Oracle services

Posted: 28 Apr 2013 11:04 AM PDT

I've got an install of Nagios XI that doesn't seem to want to talk to any of my Oracle services here. I've pulled out the monitoring command and am running it manually, after setting ORACLE_HOME and LD_LIBDRARY_PATH of course, but it keeps generating the following error:

/usr/local/nagios # libexec/check_oracle_health --connect "oracle-server:1551" --username user --password "pass" --name OFFDB1 --mode tablespace-can-allocate-next --warning 20 --critical 30  CRITICAL - cannot connect to oracle-server:1551. ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA (DBD ERROR: OCIServerAttach)  

I'm still fairly new to Oracle, but my googlings seem to indicate that SERVICE_NAME should match the GLOBAL_DBNAME in listener.ora, which is OFFDB1. Do I need to do something else here like modify the connect string?

As a note, there are multiple instances of oracle sharing the target box, but each seems to be intalled to separate partitions and are running their own listeners or various ports.

innodb changing row format doesn't decrease table size?

Posted: 28 Apr 2013 08:04 PM PDT

We're currently using MySQL with innodb and we have some large tables that are compact in row format. When I change the row format to compressed we are still seeing the same size for the table. Anyone know the reason for this?

Can I use a foreign key index as a shortcut to getting a row count in an INNODB table?

Posted: 28 Apr 2013 03:04 PM PDT

I have a table that has a large number of rows in it.

The primary key (an auto-incrementing integer) is, by default, indexed.

While waiting for a row count to be returned I did an EXPLAIN in another window and the the results were as follows:

mysql> SELECT COUNT(1) FROM `gauge_data`;  +----------+  | COUNT(1) |  +----------+  | 25453476 |  +----------+  1 row in set (2 min 36.20 sec)      mysql> EXPLAIN SELECT COUNT(1) FROM `gauge_data`;  +----+-------------+------------+-------+---------------+-----------------+---------+------+----------+-------------+  | id | select_type | table      | type  | possible_keys | key             | key_len | ref  | rows     | Extra       |  +----+-------------+------------+-------+---------------+-----------------+---------+------+----------+-------------+  |  1 | SIMPLE      | gauge_data | index | NULL          | gauge_data_FI_1 | 5       | NULL | 24596487 | Using index |  +----+-------------+------------+-------+---------------+-----------------+---------+------+----------+-------------+  1 row in set (0.13 sec)  

Since the primary key is guaranteed to be unique, can I just take the number of rows from the EXPLAIN and use that as the row count of the table?

BTW, I believe the difference in numbers is due to the fact that more data is continually being added to this table.

Database setup/design for multiple services

Posted: 28 Apr 2013 02:04 PM PDT

I am working on a new MySQL database that will store orders/customer information for around 15 different services. 7 of the services are similar in regards to the information that is stored with a few of the 7 services requiring an additional piece of information. There other 7-8 services are similar to each other as well but not as similar the the first 7. So my question is how should I break this down into a MySQL database?

Should each service have its own table? If this is true, what is the best way to link tables? Any advice is greatly appreciated!

Also, here is a sample of the type of info that will be stored:

enter image description here

Violates foreign key constraint

Posted: 28 Apr 2013 07:07 PM PDT

I'm trying to implement the below represented UML and I can't figure out where is my mistake since I have already place a value into the table.

UML class diagram

-- Schema: public    DROP SCHEMA IF EXISTS public CASCADE;    CREATE SCHEMA public    AUTHORIZATION postgres;  GRANT ALL ON SCHEMA public TO postgres;  GRANT ALL ON SCHEMA public TO public;  COMMENT ON SCHEMA public IS 'standard public schema';    CREATE TYPE color AS ENUM ('green','black','yellow','grey','blue');  CREATE TYPE arrowtype AS ENUM ('both_arrows','begin_arrow','end_arrow');   CREATE TYPE treetype AS ENUM ('orange_tree','apple_tree');  CREATE TYPE linetype AS ENUM ('hairline','solid','dotted','dashed');    CREATE TYPE address AS (  street_name TEXT,  street_no TEXT  );    CREATE TYPE square AS (  row VARCHAR(10),  colmn VARCHAR(10)  );    CREATE TABLE user_table (  username VARCHAR(30) NOT NULL PRIMARY KEY,  password VARCHAR(16),  name     VARCHAR(100),  lastname VARCHAR(100),  telephone VARCHAR(20)[],  address address,  birth_year INTEGER  );    CREATE TABLE GraphPanel (  id SERIAL NOT NULL PRIMARY KEY,  title VARCHAR(255),  creation_date TIMESTAMP,  comments TEXT  );    CREATE TABLE GraphObject (  id SERIAL NOT NULL PRIMARY KEY,  color color,  title VARCHAR(255)  );    CREATE TABLE House (  roof_color color,  roof_height INTEGER,  position square  )INHERITS(GraphObject);    CREATE TABLE Arrow (  arrow_line linetype,  arrow_type arrowtype  )INHERITS(GraphObject);    CREATE TABLE Tree (  position square,  tree_type treetype  )INHERITS(GraphObject);    CREATE TABLE creator (  username VARCHAR(30),  panel INTEGER,  category VARCHAR(50),  FOREIGN KEY (username) REFERENCES user_table(username),  FOREIGN KEY (panel) REFERENCES GraphPanel(id)  );    CREATE TABLE container (  panel  INTEGER,  gobject INTEGER,  FOREIGN KEY (panel) REFERENCES GraphPanel(id),  FOREIGN KEY (gobject) REFERENCES GraphObject(id)  );    -- INSERTING VALUES     -- Users    INSERT INTO user_table (      username,      password,name,      lastname,      telephone,      address,      birth_year  ) VALUES (      'giannis',      'thepassword',      'Giannis',      'Christofakis',      '{"6944789333","2831051300"}',      ROW('Evridikis','7'),      1985  );    INSERT INTO user_table (      username,      password,      name,      lastname,      telephone,      address,      birth_year  ) VALUES (      'antonis',      'psw',      'Antonis',      'Papadakis',      '{"6974246700","2831051312"}',      ROW('Doukos Mpofor','12'),      1993  );    INSERT INTO user_table (      username,      password,      name,      lastname,      telephone,      address,      birth_year  ) VALUES (      'mpampis',      'thepsw',      'Mpampis',      'Theodorou',      '{"6984652333","284131100"}',      ROW('Markoy Portaliou','8'),      1981  );    -- SELECT * FROM user_table;    -- GraphPanels    INSERT INTO GraphPanel (      title,      creation_date,      comments  ) VALUES (      'Platia Sinani',      '2004-10-19 10:23:54',      'Diamorfosi ths platias Sinani'  );    INSERT INTO GraphPanel (      title,      creation_date,      comments  ) VALUES (      'Parking TEI',      '2008-11-04 22:20:01',      'Apeikonisi parking tou TEI'  );    INSERT INTO GraphPanel (      title,      creation_date,      comments  ) VALUES (      'Perioxh Stavormenou',      '2011-05-17 18:23:33',      'Dimhourgeia parkou sth perioxh tou Estavromenou'  );    INSERT INTO GraphPanel (      title,      creation_date,      comments  ) VALUES (      'Odos Panagiotaki',      '2000-09-22 11:00:33',      'Kataskeuh gefuras'  );    -- SELECT * FROM GraphPanel;    -- creator    INSERT INTO creator (      username,      panel,      category  ) VALUES (      'giannis',       1,      'Diamorfosh'  );    INSERT INTO creator (      username,      panel,      category  ) VALUES (      'mpampis',       2,      'Apeikonish'  );    INSERT INTO creator (      username,      panel,      category  ) VALUES (      'antonis',       3,      'Kataskeuh'  );    INSERT INTO creator (      username,      panel,      category  ) VALUES (      'giannis',       4,      'Kataskeuh'  );    -- SELECT * FROM creator;    -- GraphObjects    -- House    INSERT INTO HOUSE (      color,      title,      roof_color,      roof_height,      position  ) VALUES (      'grey',      'Ate Bank',      'green',       6,       ROW('12','A3')  );    INSERT INTO HOUSE (      color,      title,      roof_color,      roof_height,      position  ) VALUES (      'grey',      'residents house',      'blue',       4,       ROW('23','Y3')  );    INSERT INTO HOUSE (      color,      title,      roof_color,      roof_height,      position  ) VALUES (      'blue',      'Super Market',      'yellow',       7,       ROW('08','L2')  );    -- SELECT * FROM House;    -- Trees    INSERT INTO Tree (      color,      title,      position,      tree_type  ) VALUES (      'green',      'valencia',       ROW('07','L2'),       'orange_tree'  );    INSERT INTO Tree (      color,      title,      position,      tree_type  ) VALUES (      'green',      'mantarinia',       ROW('18','J2'),       'orange_tree'  );    INSERT INTO Tree (      color,      title,      position,      tree_type  ) VALUES (      'green',      'firikia',       ROW('03','E1'),       'apple_tree'  );    -- SELECT * FROM Tree;    INSERT INTO Arrow (      color,      title,      arrow_line,      arrow_type  ) VALUES (      'black',      'starting point',       'solid',       'begin_arrow'  );    INSERT INTO Arrow (      color,      title,      arrow_line,      arrow_type  ) VALUES (      'grey',      'ending way',       'dashed',       'end_arrow'  );    INSERT INTO Arrow (      color,      title,      arrow_line,      arrow_type  ) VALUES (      'black',      'both ways',       'dotted',       'both_arrows'  );     SELECT * FROM GraphObject order by id;    -- container        INSERT INTO container (      panel,      gobject  ) VALUES (       1,       6  );      SELECT * FROM container;    -- SELECT table_name FROM information_schema.tables WHERE table_schema = 'public';  

The error is about my last portion of code.

ERROR: insert or update on table "container" violates foreign key constraint "container_gobject_fkey" DETAIL: Key (gobject)=(6) is not present in table "graphobject".

*** Error ***

ERROR: insert or update on table "container" violates foreign key constraint "container_gobject_fkey" SQL state: 23503 Detail: Key (gobject)=(6) is not present in table "graphobject".


UPDATE

OK I misunderstood inheritance. Can anyone advice me how to implement the contains relationship between GraphPanel and GraphObject,Tree,Arrow,House.

FATAL: terminating autovacuum process due to administrator command

Posted: 28 Apr 2013 04:04 AM PDT

I am running postgresql 8.4 on Ubuntu 10.0.4. I was in the process of creating schemas/importing data when I came across some error messages. Here is a snippet of the output at the console:

CREATE AGGREGATE  CREATE AGGREGATE  CREATE DATABASE  FATAL:  terminating autovacuum process due to administrator command  CREATE DATABASE  CREATE DATABASE  CREATE DATABASE  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  LOG:  unexpected EOF on client connection  

BTW, I have checked and the postgres processes seem to be still running:

username@localhost:~/work/scripts/init$ ps aux | grep postgres  postgres 13196  0.1  0.1 102240  6264 pts/1    S    00:23   0:00 /usr/lib/postgresql/8.4/bin/postgres -D /mydata/pgdbdata  postgres 13198  0.0  0.2 102456  8612 ?        Ss   00:23   0:00 postgres: writer process                                      postgres 13199  0.0  0.0 102240  1584 ?        Ss   00:23   0:00 postgres: wal writer process                                  postgres 13200  0.0  0.0 102568  1888 ?        Ss   00:23   0:00 postgres: autovacuum launcher process                         postgres 13201  0.0  0.0  73956  1576 ?        Ss   00:23   0:00 postgres: stats collector process                             postgres 13263  0.0  0.1 104276  6484 ?        Ss   00:25   0:00 postgres: postgres postgres 127.0.0.1(42338) idle   

What is likely to be causing this and how may I resolve the problem?.

No comments:

Post a Comment

Search This Blog