kokizzu / plv8js Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/plv8js
License: Other
Automatically exported from code.google.com/p/plv8js
License: Other
A Procedural Language in JavaScript powered by V8 ================================================= plv8 is a shared library that provides a PostgreSQL procedural language powered by V8 JavaScript Engine. With this program you can write in JavaScript your function that is callable from SQL. REQUIREMENT ----------- plv8 is tested with: - PG: version 8.4, 9.0, 9.1, 9.2 and 9.3dev (maybe older are allowed) - V8: version 3.14.5 - g++: version 4.5.1 It is also known to work with some older versions of gcc and v8. Also all tools that PostgreSQL and V8 require to be built are required if you are building those from source. INSTALL ------- There are two ways to build plv8. The first is default `make`, which depends on system-installed libv8 and plv8 will be dynamically link to it. The second is `make static`, which will download v8 soure at a specific version and build it, and statically link plv8 to it. PGXN install will use the former, while you can do the latter manually if you have not installed v8 yet. Once you installed plv8 into your dabase, create language via $ psql -c 'CREATE EXTENSION plv8' $ psql -c 'CREATE EXTENSION plls' $ psql -c 'CREATE EXTENSION plcoffee' in 9.1 or later, or in the prior versions $ psql -f plv8.sql to create database objects. In mingw64, you may have difficulty in building plv8. If so, try to make the following changes in Makefile. CUSTOM_CC = gcc SHLIB_LINK := $(SHLIB_LINK) -lv8 -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lm For more detail, please refer to http://code.google.com/p/plv8js/issues/detail?id=29 TEST ---- plv8 supports installcheck test. Make sure set custom_variable_classes = 'plv8' in your postgresql.conf (before 9.2) and run $ make installcheck EXAMPLE (JAVASCRIPT) -------------------- CREATE OR REPLACE FUNCTION plv8_test(keys text[], vals text[]) RETURNS text AS $$ var o = {}; for(var i=0; i<keys.length; i++){ o[keys[i]] = vals[i]; } return JSON.stringify(o); $$ LANGUAGE plv8 IMMUTABLE STRICT; SELECT plv8_test(ARRAY['name', 'age'], ARRAY['Tom', '29']); plv8_test --------------------------- {"name":"Tom","age":"29"} (1 row) EXAMPLE (COFFEESCRIPT) ---------------------- CREATE OR REPLACE FUNCTION plcoffee_test(keys text[], vals text[]) RETURNS text AS $$ return JSON.stringify(keys.reduce(((o, key, idx) -> o[key] = vals[idx]; return o), {}), {}) $$ LANGUAGE plcoffee IMMUTABLE STRICT; SELECT plcoffee_test(ARRAY['name', 'age'], ARRAY['Tom', '29']); plcoffee_test --------------------------- {"name":"Tom","age":"29"} (1 row) EXAMPLE (LIVESCRIPT) -------------------- CREATE OR REPLACE FUNCTION plls_test(keys text[], vals text[]) RETURNS text AS $$ return JSON.stringify { [key, vals[idx]] for key, idx in keys } $$ LANGUAGE plls IMMUTABLE STRICT; SELECT plls_test(ARRAY['name', 'age'], ARRAY['Tom', '29']); plls_test --------------------------- {"name":"Tom","age":"29"} (1 row) NOTES ----- plv8 is hosted at Google Project Hosting http://code.google.com/p/plv8js/ and distributed by PGXN. For more detail, see http://pgxn.org/dist/plv8/doc/plv8.html
Deprecate print/executeSql/createPlan, etc. At least, emit WARNING when used.
Original issue reported on code.google.com by [email protected]
on 17 Apr 2012 at 9:44
Support to modify NEW in triggers. Why haven't we support it though we have
trigger support?
Original issue reported on code.google.com by [email protected]
on 3 Feb 2012 at 10:31
What steps will reproduce the problem?
1. connect to plv8 with d8: /d8 --remote-debugger --debugger_port=35432
2. issue any sql statement: plv8.execute("select 1==1");
result: (pg backend crash)
FATAL: BeginInternalSubTransaction: unexpected state DEFAULT
What version of the product are you using? On what operating system?
plv8 1.3.0, pg 9.2.2 OS X 10.8.2
googled it and found:
http://postgresql.1045698.n5.nabble.com/backend-crash-with-FATAL-BeginInternalSu
bTransaction-unexpected-state-END-td2123467.html
Beyond my debugging skills, but I guess because I'm not in an sql function than
the current transaction is in a non-supported state. I tried to
plv8.execute("BEGIN") but that didn't help either.
Original issue reported on code.google.com by [email protected]
on 15 Jan 2013 at 7:38
# do $$ plv8.execute("select current_schemas(true)") $$ language plv8;
The connection to the server was lost. Attempting reset: Failed.
expected:
# select current_schemas(true);
current_schemas
---------------------
{pg_catalog,public}
(1 row)
Using plv8 latest trunk, postgres 9.1.3
Thanks
Original issue reported on code.google.com by [email protected]
on 16 May 2012 at 5:07
CREATE OR REPLACE FUNCTION v8repl(text, int) RETURNS text AS $$
var buf = [];
for(var i = 0; i < $2; i++){
buf.push( $1 );
}
return buf.join( "," );
$$ LANGUAGE plv8;
SELECT v8repl('test', 10);
CREATE OR REPLACE FUNCTION v8repl(text, int) RETURNS text AS $$
var buf = [];
for(var i = 0; i < $2; i++){
buf.push( $1 );
}
return buf.join( "-" );
$$ LANGUAGE plv8;
SELECT v8repl('test', 10);
CREATE FUNCTION
v8repl
---------------------------------------------------
test,test,test,test,test,test,test,test,test,test
(1 row)
CREATE FUNCTION
v8repl
---------------------------------------------------
test,test,test,test,test,test,test,test,test,test
(1 row)
=====
Actually, the second result is wrong.
Original issue reported on code.google.com by [email protected]
on 28 Aug 2010 at 5:44
Because json is a built-in type in 9.2, it is a reasonable request that plv8
converts the in/out value automatically. Not sure how difficult upgrade would
be. This may be beneficial when js function that takes js object is called via
fin_function.
Original issue reported on code.google.com by [email protected]
on 29 Nov 2012 at 8:22
Add quote_literal() and family functions to plv8.
Original issue reported on code.google.com by [email protected]
on 17 Apr 2012 at 9:40
-----------------
CREATE OR REPLACE FUNCTION spi_test() RETURNS int AS $$
try{
executeSql('ERROR;');
}catch (e){
print(NOTICE, 'catch');
}
$$ LANGUAGE plv8 IMMUTABLE STRICT;
SELECT spi_test();
-----------------
Result:
----------
NOTICE: catch
ERROR: SPI_finish() failed
---------------
* What version of the product are you using? On what operating system?
postgresql - 9.0.4
plv8js - Changeset 23:bd6caea027c4 (Sat Oct 29 14:02:03 2011 -0400)
Original issue reported on code.google.com by [email protected]
on 10 Nov 2011 at 1:16
pl/perl has $_SHARED and pl/python has SD/GD. I heard from someone that he
wants to use something like them. I found plv8 can do it with "this" but am not
sure if it should be used or such global variables should be supported. If yes,
we need to take care of it and document it.
db1=# create function f() returns int as $$ if (!this.i) this.i = 0; this.i++;
return this.i; $$ language plv8;
CREATE FUNCTION
db1=# select f();
f
---
1
(1 row)
db1=# select f();
f
---
2
(1 row)
db1=# select f();
f
---
3
(1 row)
Original issue reported on code.google.com by [email protected]
on 3 Feb 2012 at 10:29
In the issue #35, we added LiveScript suuport. However, in order to support
more dialects around JavaScript, we need more sanity way to add them.
One of the main concerns is the build system. Maybe we can include every
dialect in the all rule, and for the people who want only plv8 we can supply a
plv8 build rule.
Original issue reported on code.google.com by [email protected]
on 16 Sep 2012 at 4:13
What steps will reproduce the problem?
With PL/pgSQL, returning NULL by BEFORE TRIGGER cancels query. However, PLV8
doesn't cancel.
CREATE TABLE test (
id SERIAL NOT NULL,
txt TEXT,
deleted BOOLEAN DEFAULT FALSE NOT NULL
);
CREATE OR REPLACE FUNCTION test_delete_trigger() RETURNS trigger AS $$
return null; // Do not have any effect with PLV8
// return; return ''; return 0; return false; are the same
$$ LANGUAGE plv8;
CREATE TRIGGER test_del BEFORE DELETE ON test FOR EACH ROW EXECUTE PROCEDURE
test_delete_trigger();
insert into test (txt) values ('a');
insert into test (txt) values ('a');
insert into test (txt) values ('a');
delete from test where id = 1;
delete from test where id = 2;
delete from test where id = 3;
What is the expected output? What do you see instead?
Canceled query, but rows are deleted.
What version of the product are you using? On what operating system?
MomongaLinux7 x86_64
- gcc/g++ 4.4.4
- glibc 2.12.90
PostgreSQL 9.2.1 (ソース配布版)
V8 3.15.6.0 (src/version.cc)
PL/V8 1.3.0devel (plv8_config.h)
Please provide any additional information below.
Following PL/pgSQL function cancels query.
CREATE OR REPLACE FUNCTION test_delete_trigger() RETURNS trigger AS $$
DECLARE
BEGIN
UPDATE test SET deleted = true WHERE id = OLD.id;
return null; // Returning null cancel query with PL/pgSQL
END;
$$ LANGUAGE plpgsql;
Original issue reported on code.google.com by [email protected]
on 27 Nov 2012 at 5:35
Would like to be able to confirm version of plv8 installed at runtime. -- thx
Original issue reported on code.google.com by [email protected]
on 11 May 2012 at 9:36
I'd like to have binary builds in Windows (32/64), Mac (64), Linux (RHEL, 64)
for the public release.
Original issue reported on code.google.com by [email protected]
on 28 Apr 2012 at 9:08
Hi! Attached please find patches from:
https://code.google.com/r/audreytang-plv8js-ls
That contains support for the ENABLE_LIVESCRIPT makefile flag, as well as the
internal "Dialect" enum adjusted to support multiple JavaScript dialects.
Thank you for your great work in introducing CoffeeScript in the first place!
Original issue reported on code.google.com by [email protected]
on 4 Sep 2012 at 5:28
Attachments:
Being able to write coffeescript syntax inside postgresql would be amazing.
Not sure of the best way to make that happen.
Original issue reported on code.google.com by [email protected]
on 10 Sep 2011 at 5:48
What steps will reproduce the problem?
1. CREATE OR REPLACE FUNCTION upsert_inventory(param_inv json) RETURNS
text AS $$
var o = JSON.parse(param_inv);
var uplan = plv8.prepare('UPDATE inventory
SET prod_name = $1, loc_id = $2 WHERE prod_code = $3', ['varchar', 'int', 'varchar'] );
var iplan = plv8.prepare('INSERT INTO inventory( prod_name, loc_id, prod_code)
VALUES($1, $2, $3', ['varchar', 'int', 'varchar'] );
var num_changed;
if (typeof ej != 'object')
return NULL;
else {
for(var i=0; i<o.length; i++){
num_changed = uplan.execute(o[i]['prod_name'], o[i]['loc_id'], o[i]['prod_code']);
if (num_changed == 0){ /** record does not exist add it **/
iplan.execute(o[i]['prod_name'], o[i]['loc_id'], o[i]['prod_code']);
}
}
}
return 'done';
$$ LANGUAGE plv8 VOLATILE;
What is the expected output? Hmm it gives an error.
What do you see instead? Crashes my session.
NOTE: If I change the statement to this it doesn't crash and saves fine. The
difference between the two is I have line breaks in my SQL statements in the
crashing ones.
CREATE OR REPLACE FUNCTION upsert_inventory(param_inv json) RETURNS
text AS $$
var o = JSON.parse(param_inv);
var uplan = plv8.prepare('UPDATE inventory SET prod_name = $1, loc_id = $2
WHERE prod_code = $3', ['varchar', 'int', 'varchar'] );
var iplan = plv8.prepare('INSERT INTO inventory( prod_name, loc_id, prod_code)
VALUES($1, $2, $3', ['varchar', 'int', 'varchar'] );
var num_changed;
if (typeof ej != 'object')
return NULL;
else {
for(var i=0; i<o.length; i++){
num_changed = uplan.execute(o[i]['prod_name'], o[i]['loc_id'], o[i]['prod_code']);
if (num_changed == 0){ /** record does not exist add it **/
iplan.execute(o[i]['prod_name'], o[i]['loc_id'], o[i]['prod_code']);
}
}
}
return 'done';
$$ LANGUAGE plv8 VOLATILE;
What version of the product are you using? On what operating system?
I compiled under mingw64 gcc 4.5.4. I tested under both my mingw64 PostgreSQL
build and the EDB PostgreSQL 9.2beta2 builds and both give the same problem.
Please provide any additional information below.
PostgreSQL 9.2beta2
Windows 7 64-bit (I tested on 32-bit EDB and 64-bit mingw built PostgreSQL
(64-bit) )
The postgres logs show:
ERROR: column "spclocation" does not exist at character 25
STATEMENT: SELECT ts.oid, spcname, spclocation, spcoptions,
pg_get_userbyid(spcowner) as spcuser, spcacl, pg_catalog.shobj_description(oid,
'pg_tablespace') AS description FROM pg_tablespace ts
ORDER BY spcname
terminate called after throwing an instance of 'js_error';
Using V8 compiled from trunk (Jul 15 2012 or so) and PL/V8 from git around Jul
15 2012
I assume its something with the parser. Note to compile plv8 I had to change
SHLIB_LINK to (added stdc++)
SHLIB_LINK := $(SHLIB_LINK) -lv8 -lstdc++
as described
http://www.postgresonline.com/journal/archives/261-Building-PLV8JS-and-PLCoffee-
for-Windows-using-MingW64-w64-w32.html
so not sure if that is part of the issue. I did leave setting to compile with
g++ though.
Original issue reported on code.google.com by [email protected]
on 21 Jul 2012 at 3:16
Currently it's a placeholder, but we should be able to execute a saved plan
without having to use a cursor.
Original issue reported on code.google.com by [email protected]
on 27 Apr 2012 at 3:13
What steps will reproduce the problem?
create or replace function xxx(n int) returns setof record language plv8 as
$x$ var i; for (i=0; i<n; i++) yield({n: i*2}); $x$;
select * from xxx(3) as x(x int);
What is the expected output?
empty records
What do you see instead?
error.
Original issue reported on code.google.com by [email protected]
on 30 Oct 2011 at 10:04
Currently we have one global context. But this has been deemed a security issue
in other PLs because of the possibility of redefinition of global objects
affecting Security Definer functions. For PLV8 I think we need a per-user
context allocated and stashed inside GetGlobalContext().
Original issue reported on code.google.com by [email protected]
on 10 Nov 2011 at 4:12
Branch name: subtran
Purpose of code changes on this branch:
Add subtransaction() to issue sub-transaction.
When reviewing my code changes, please focus on:
The change is WIP and I'll add tests etc.
After the review, I'll merge this branch into: master
Original issue reported on code.google.com by [email protected]
on 20 Mar 2012 at 9:25
What steps will reproduce the problem?
Make installcheck
What is the expected output? What do you see instead?
instead of success, this failure:
*** /home/andrew/plv8js/expected/plv8.out 2011-09-10 15:35:14.000000000 -0400
--- /home/andrew/plv8js/results/plv8.out 2011-09-22 18:33:18.088773716 -0400
***************
*** 153,159 ****
SELECT text_to_date('23 Dec 2010 GMT');
text_to_date
--------------
! 12-23-2010
(1 row)
CREATE FUNCTION oidfn(id oid) RETURNS oid AS $$ return id $$ LANGUAGE plv8;
--- 153,159 ----
SELECT text_to_date('23 Dec 2010 GMT');
text_to_date
--------------
! 05-02-474040
(1 row)
CREATE FUNCTION oidfn(id oid) RETURNS oid AS $$ return id $$ LANGUAGE plv8;
Looks like it's probably an issue in EpochToDate()
Original issue reported on code.google.com by [email protected]
on 22 Sep 2011 at 11:04
create table arraytest(id int, value text);
insert into arraytest values(1,'one');
insert into arraytest values(2,'two');
Selecting the table returns an array, with the table properly converted to JSON:
DO language plv8 'print(NOTICE,JSON.stringify(executeSql("select arraytest json
from arraytest")))';
-> NOTICE: [{"json":{"id":1,"value":"one"}},{"json":{"id":2,"value":"two"}}]
Same query, only selecting it as an array, returns an array of strings:
DO language plv8 'print(NOTICE,JSON.stringify(executeSql("select array(select
arraytest from arraytest) json")))';
-> NOTICE: [{"json":["(1,one)","(2,two)"]}]
Original issue reported on code.google.com by [email protected]
on 20 Mar 2012 at 9:19
What steps will reproduce the problem?
I'm running on mingw, but I think the issue is really incompatibility with
plv8 and v8 trunk. Perhaps a non-issue since v8 trunk is technically not
stable yet
I was able to build and test fine with the recommended v8 3.14.5
1. building with v8 (http://v8.googlecode.com/svn/trunk) r13185 December 10th
2. compile plv8 1.3.0 tagged version
What is the expected output?
It compiles
What do you see instead?
plv8.o:plv8.cc:(.text+0x106f): undefined reference to
`v8::Object::SlowGetInternalField(int)'
What version of the product are you using? On what operating system?
postgresql 9.2, mingw64-w32, windows 7
Original issue reported on code.google.com by [email protected]
on 11 Dec 2012 at 3:22
What steps will reproduce the problem?
1. brew install v8
2. make install
3.
What is the expected output? What do you see instead?
g++ -O2 -pthread -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -bundle -multiply_defined
suppress -o plv8.so plv8.o plv8_type.o plv8_func.o plv8_param.o coffee-script.o
-L/usr/local/lib -Wl,-dead_strip_dylibs -lv8 -bundle_loader
/usr/local/bin/postgres
Undefined symbols for architecture x86_64:
"_DirectFunctionCall1", referenced from:
find_js_function_by_name(char const*) in plv8.o
ToScalarValue(unsigned long, bool, plv8_type*) in plv8_type.o
ToScalarDatum(v8::Handle<v8::Value>, bool*, plv8_type*) in plv8_type.o
quote_literal_cstr(char const*) in plv8_func.o
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make: *** [plv8.so] Error 1
What version of the product are you using? On what operating system?
os x 10.7
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 30 Oct 2012 at 9:51
Currently SRFs can only return records.
Original issue reported on code.google.com by [email protected]
on 6 Oct 2011 at 12:18
What steps will reproduce the problem?
returning a value from a try/catch with a js error works as expected, however
if the error is caused by postgres, returning a value crashes the server. To
reproduce, run the below example -- NOTE: it will crash postgres
CREATE OR REPLACE function plv8_dump() returns text language plv8 as
$JS$
/* this works: returns: "error: oneBadFunc is not defined"
try {
oneBadFunc();
} catch(e) {
return "error: "+e.message;
}
*/
/* this brings down entire server */
try {
plv8.execute("SELECT * FROM null_table WHERE ",[8]);
} catch(e) {
// throw e; //<-- does not crash
return "error: "+e.message;
}
$JS$;
What version of the product are you using? On what operating system?
postgres: 9.2.1, plv8 1.3.0devel
Also commented, but if the error is thrown in the catch postgres will not die
Original issue reported on code.google.com by [email protected]
on 5 Jan 2013 at 7:51
These are required for packaging among other things.
Original issue reported on code.google.com by [email protected]
on 23 Jul 2012 at 11:57
When I try to run the yield example, I get this: ERROR: ReferenceError: yield
is not defined
Original issue reported on code.google.com by [email protected]
on 10 May 2012 at 10:14
hstore value is returned as a string, a javascript object is obviously
preferable. I'm looking at writing a parser in js for now, but wondered if
this could be handled by plv8 natively.
current output:
psql=# do language plv8 $$ plv8.elog(NOTICE,plv8.execute("SELECT
'a=>1,b=>2'::hstore;")[0].hstore); $$;
NOTICE: "a"=>"1", "b"=>"2"
desired output:
js obj: {a:"1", b:"2"}
Thanks
Original issue reported on code.google.com by [email protected]
on 27 Jun 2012 at 7:14
Wrap and Unwrap are depricated in v8. It is recommended to use New, Cast and
Value instead.
Included is a quick fix that worked with the newest v8, But I'm not a c/c++
coder so someone look through it.
Made with Antti Jokipii.
Original issue reported on code.google.com by [email protected]
on 31 Jan 2013 at 3:35
Attachments:
PLPerl keeps a hash table of query-desc objects and just hands the user an
opaque name for the object, When the plan is used, it is looked up in the hash
table and the actual plan pointer is retrieved. We need to do something
similar. That way the user can't just hand us an arbitrary pointer and have us
treat it as a plan pointer.
Original issue reported on code.google.com by [email protected]
on 30 Oct 2011 at 1:43
How can I signal plv8 to reinitialize or de-initialize for all sessions, like
issuing \c from psql?
pg docs has an alter database reset:
http://www.postgresql.org/docs/9.1/static/sql-alterdatabase.html
But this does not reset plv8.
The use case for this is deploying new/updated code. It's a bummer to have to
restart the entire database server.
Original issue reported on code.google.com by [email protected]
on 30 May 2012 at 4:50
We need to make sure that we don't have to materialize a whole result set from
Execute SQL in memory. The best way to do that is with cursor support. A
preliminary sketch of the API I have done is:
extern v8::Handle<v8::Value> CreateSqlPlan(const v8::Arguments& args) throw();
extern v8::Handle<v8::Value> FreeSqlPlan(const v8::Value& arg) throw();
extern v8::Handle<v8::Value> CreateSqlCursor(const v8::Arguments& args) throw();
extern v8::Handle<v8::Value> FetchSqlCursor(const v8::Value& arg) throw();
extern v8::Handle<v8::Value> CloseSqlCursor(const v8::Value& arg) throw();
To make this work we'll need to move the calls to SPI_Connect() andf
SPI_finish() out to where they surround the outer JS function call.
We can also cache the cursor if need be to the end of the transaction.
Original issue reported on code.google.com by [email protected]
on 22 Sep 2011 at 8:50
What steps will reproduce the problem?
1. install the extension
2. run sql command:
DO $$ plv8.elog(NOTICE, 'this', 'is', 'inline', 'code') $$ LANGUAGE plv8;
What is the expected output? What do you see instead?
Expected: some text
I get:
ERROR: ReferenceError: plv8 is not defined
DETAIL: undefined() LINE 1: plv8.elog(NOTICE, 'this', 'is', 'inline', 'code')
********** Error **********
ERROR: ReferenceError: plv8 is not defined
SQL state: XX000
What version of the product are you using? On what operating system?
Postgresql 9.1.2
plv8 snapshot 2011-09-11
v8 from svn
Original issue reported on code.google.com by [email protected]
on 16 Apr 2012 at 3:50
Starting the V8 debugger will make it listen on a specified TCP port. Hence the
PG server process will continue to talk to the PG client on it's own port, but
additionally talk on the V8 debug port to a V8 debugger that attached.
http://code.google.com/p/v8/wiki/AddDebuggerSupport
Original issue reported on code.google.com by [email protected]
on 26 Sep 2012 at 9:47
v8 supports "external array" which makes v8 object be a simple wrapper for
actual memory chuck. For bytea, we haven't converted it to v8 object
meaningfully, so probably it makes sense. This will allow just store binary
object in bytea column and users can write a iterative way to read the binary
data in plv8 function. It simply applies to _int, _short, _float etc, but
since we've supported pg array -> js array conversion, this may introduce
backward-incompatibility.
Original issue reported on code.google.com by [email protected]
on 2 Dec 2012 at 11:05
What steps will reproduce the problem?
1. CUSTOM_CC = gcc
What is the expected output? What do you see instead?
I expect it not to use g++
But it seems g++ is hard-coded on line 36 of Makfile
g++ $(CCFLAGS) $(CPPFLAGS) -I $(V8DIR)/include -fPIC -c -o $@ $<
This should probably be changed to
${CUSTOM_CC} $(CCFLAGS) $(CPPFLAGS) -I $(V8DIR)/include -fPIC -c -o $@ $<
As noted in ticket #29, I had to switch to using gcc under mingw to force
libstdc++ to be statically compiled. So I had to make this additional change
to force use of my CUSTOM_CC.
Original issue reported on code.google.com by [email protected]
on 25 Jul 2012 at 1:51
I am using
- PostgreSQL 9.2 RC1
- V8 3.13.3.1
- PL/V8 (from https://code.google.com/p/plv8js/)
As a baseline, I am able to build and run all above as expected on Ubuntu 10.04
LTS i386.
Now, all of the following give the same behavior: as soon as I create a
function (or run make installcheck), the PG client will /hang forever/.
Tested:
- FreeBSD 9 Rel. : i386 and AMD64
- GCC 4.2.1 (from system) and GCC 4.6.2 (from ports collection)
- PostgreSQL 9.1.5 and 9.2 RC1
I have run the V8 regression tests for all builds successfully (100% green). So
the V8 library itself seems to be working. PG for itself I assume is also not
the problem (I tested 9.1.5 also).
Original issue reported on code.google.com by [email protected]
on 27 Aug 2012 at 4:24
It looks like the V8_SRCDIR option disappeared in
90190dc310d1c460dfb510c9e30925cc7575d836. I was using that :)
Original issue reported on code.google.com by [email protected]
on 20 Dec 2012 at 5:40
What steps will reproduce the problem?
create or replace function xxx(n int) returns setof record language plv8 as
$x$ var i; for (i=0; i<n; i++) yield(i*2); $x$;
select * from xxx(3) as x(n int);
What is the expected output?
error
What do you see instead?
The connection to the server was lost. Attempting reset: Failed
Original issue reported on code.google.com by [email protected]
on 30 Oct 2011 at 10:06
https://twitter.com/danfarina/status/245423867177340928
Original issue reported on code.google.com by [email protected]
on 13 Sep 2012 at 6:40
create or replace function test1(i int) returns setof record as $$
return [{ i: true }]
$$ language plcoffee;
select test1(2);
Shows this in the logs:
LOG: duration: 0.859 ms statement: create or replace function test1(i int)
returns setof record as $$
return [{ i: true }]
$$ language plcoffee;
LOG: server process (PID 83707) was terminated by signal 11: Segmentation fault
Original issue reported on code.google.com by [email protected]
on 10 May 2012 at 10:13
Just for my fun :)
Original issue reported on code.google.com by [email protected]
on 1 Dec 2012 at 11:47
Hi,
We can't get plcoffee to work...
make ENABLE_COFFEE=1 install
passed well, without any problems...
make ENABLE_COFFEE=1 installcheck
passed - but noticed there are no test for plcoffee
create new DB,
CREATE EXTENSION (both, plv8 and plcoffee) passed well...
CREATE LANGUAGE - a bit unusual - for both says language already exists...
plv8 functions - works fine (as DO)
CREATE FUNCTION in plcoffee breaks - without an error - just connection
breaks...
The same happens and for DO statemebts:
DO LANGUAGE plcoffee
$$
$$
even it is empty... or not empty and no syntax error... just breaks
connection...
The same happens in PgAdmin from client machine.. as on psql on the server...
Server: Ubuntu 1204
Pg: 9.2
plv8js - latest snapshot...
Any advice?
Thanks,
Misa
Original issue reported on code.google.com by [email protected]
on 25 Sep 2012 at 12:30
According to the docs, prepared statements must be free'd before leaving the
function, this makes them useful only for statements that will be repeated in
the same function.
A use case more common to our app is the need to optimize calling a function
repeatedly so it would be nice to store the prepared statement in a lasting
scope.
I am trying out the idea of putting the prepared statements in plv8.$prepared
on init and not calling free. This goes against the docs so I'm not sure what
kind of trouble I'm seeking, but is seems to be working thus far.
Thanks
Original issue reported on code.google.com by [email protected]
on 5 Jan 2013 at 8:40
I'm working with the popular OS X packaging tool homebrew to include plv8
(https://github.com/mxcl/homebrew/pull/10114)
One concern they raised was that there isn't a tagged version number.
Could we please get 1d69da3c36474943a8e2a68037b8f8ca5a102ea7 tagged with a
version number of some sort?
Original issue reported on code.google.com by [email protected]
on 13 Feb 2012 at 12:20
In last change
http://code.google.com/p/plv8js/source/detail?r=02f7f832b1634b343a60add59176c4e2
07d9faf2
You bumped to 1.2.0, but the Makefile has EXTVER set to 1.1.0 still so is
generating a -1.1.0.sql file.
Original issue reported on code.google.com by [email protected]
on 22 Jul 2012 at 5:17
Write adequate amount of document in README, which will be helpful when we
upload to PGXN.
Original issue reported on code.google.com by [email protected]
on 28 Apr 2012 at 9:07
This might not be a bug, but I'm having a rough go with type coercion errors so
hopefully this can be fixed.
summary: (id is type integer)
plv8.execute("select * from typetest where id = '1'") -- works
plv8.execute("select * from typetest where id = $1",['1']) -- Error: operator
does not exist: integer = text
detail:
CREATE TABLE typetest (id serial, name text);
INSERT INTO typetest(name) values('test');
do $$ plv8.elog(NOTICE,JSON.stringify(plv8.execute("select * from typetest
where id = '1'"))) $$ language plv8;
do $$ plv8.elog(NOTICE,JSON.stringify(plv8.execute("select * from typetest
where id = $1",['1']))) $$ language plv8;
DROP TABLE typetest;
output:
psql:db/plv8bug.sql:1: NOTICE: CREATE TABLE will create implicit sequence
"typetest_id_seq" for serial column "typetest.id"
CREATE TABLE
INSERT 0 1
psql:db/plv8bug.sql:3: NOTICE: [{"id":1,"name":"test"}]
DO
psql:db/plv8bug.sql:4: ERROR: Error: operator does not exist: integer = text
DETAIL: undefined() LINE 1:
plv8.elog(NOTICE,JSON.stringify(plv8.execute("select * from typetest where id
DROP TABLE
using plv8 latest trunk, pg 9.1.3
Original issue reported on code.google.com by [email protected]
on 16 May 2012 at 8:27
What steps will reproduce the problem?
1. make ENABLE_COFFEE=1 install
I get error
./plcoffee--0.9.0.sql does not exist.
The file is called plcoffee--0.9.sql
Original issue reported on code.google.com by [email protected]
on 22 Jul 2012 at 5:19
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.