Error while executing query -pgsql

47 views
Skip to first unread message

vishnup...@gmail.com

unread,
Sep 29, 2016, 10:42:48 AM9/29/16
to opencog
Hello,

When i do (pgsql-store), i get some error. 
(use-modules (opencog) (opencog atom-types) (opencog persist-pgsql) (opencog openpsi))
(primitive-load "xxxxxx.scm")
(pgsql-open "fgf" "ccc" "dddd")
(pgsql-store)
(pgsql-close)
----------------------------------------
......
...
...
Error while executing the query
Query was: INSERT INTO Atoms (uuid, space, type, name, height, tv_type, stv_mean, stv_count, stv_confidence) VALUES (367, 1, 8, $ocp$0.000000$ocp$, 0, 1,            1,            0,            0);
Can't perform query rc=-1 (7) ERROR: duplicate key value violates unique constraint "spaces_pkey";
Error while executing the query
Query was: INSERT INTO Spaces (space, parent) VALUES (1, 1);
Can't perform query rc=-1 (7) ERROR: duplicate key value violates unique constraint "atoms_type_name_key";
Error while executing the query
Query was: INSERT INTO Atoms (uuid, space, type, name, height, tv_type, stv_mean, stv_count, stv_confidence) VALUES (367, 1, 8, $ocp$0.000000$ocp$, 0, 1,            1,            0,            0);
Can't perform query rc=-1 (7) ERROR: duplicate key value violates unique constraint "atoms_type_out_hash_out_differentiator_key";
Error while executing the query
Query was: INSERT INTO Atoms (uuid, space, type, height, out_hash, out_differentiator, tv_type, stv_mean, stv_count, stv_confidence) VALUES (370, 1, 13, 1, 4368330723998447496, 0, 1,            1,            0,            0);
Can't perform query rc=-1 (7) ERROR: duplicate key value violates unique constraint "atoms_type_out_hash_out_differentiator_key";
Error while executing the query
Query was: INSERT INTO Atoms (uuid, space, type, height, out_hash, out_differentiator, tv_type, stv_mean, stv_count, stv_confidence) VALUES (370, 1, 13, 1, 4368330723998447496, 0, 1,            1,            0,            0);
Can't perform query rc=-1 (7) ERROR: duplicate key value violates unique constraint "atoms_type_out_hash_out_differentiator_key";
Error while executing the query
Query was: INSERT INTO Atoms (uuid, space, type, height, out_hash, out_differentiator, tv_type, stv_mean, stv_count, stv_confidence) VALUES (366, 1, 15, 1, -1800332976553377133, 0, 1,            1,            0,            0);
Can't perform query rc=-1 (7) ERROR: duplicate key value violates unique constraint "atoms_type_out_hash_out_differentiator_key";
Error while executing the query
Query was: INSERT INTO Atoms (uuid, space, type, height, out_hash, out_differentiator, tv_type, stv_mean, stv_count, stv_confidence) VALUES (366, 1, 15, 1, -1800332976553377133, 0, 1,            1,            0,            0);
  Finished storing        347 atoms total.
  Reserving UUIDs up to 370 Atoms table max.
-----------------------------------------------------------

I think, Atoms in scm file are not stored. Each time i need to use (primitive-load "xxxxxx.scm"). I have also attached a sample of my scm file.

Thanks in advance.

sample.scm

Linas Vepstas

unread,
Sep 29, 2016, 11:23:26 PM9/29/16
to opencog
You need to open the database before creating atoms; otherwise, the atoms that you create will conflict with those in the database. This is actually a design flaw, but until it is fixed, you have to live with it.

--linas

--
You received this message because you are subscribed to the Google Groups "opencog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opencog+unsubscribe@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at https://groups.google.com/group/opencog.
To view this discussion on the web visit https://groups.google.com/d/msgid/opencog/009ed376-5968-491b-a285-f947940f948b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vishnu Priya

unread,
Oct 19, 2016, 9:14:16 AM10/19/16
to opencog, linasv...@gmail.com

You need to open the database before creating atoms; 

 Yeah. I did the following:

guile> (use-modules (opencog) (opencog atom-types) (opencog persist-pgsql) (opencog openpsi))
guile> (pgsql-open "xxx" "yyy" "zzz")
()
guile>(primitive-load "/opt/opencog/opencog/scm/test.scm")
guile> (pgsql-store)
()

when i closed everything and restarted, it returns empty. seems nothing is saved in DB. 
guile> (cog-chase-link 'ListLink 'ConceptNode (ConceptNode "US"))
()

What am i missing here?



Thanks,
Vishnu



Reply all
Reply to author
Forward
0 new messages