Re: [GENERAL] LYDB: What advice about stored procedures and other server side code?

2016-12-28 Thread Christoph Moench-Tegeder
## Guyren Howe (guy...@gmail.com): > I am inclined to advise folks to use PL/V8 on Postgres, because it is > a reasonable language, everyone knows it, it has good string functions, > decent performance and it tends to be installed everywhere (in particular, > Amazon RDF offers it). I'd be careful

Re: [GENERAL] LYDB: What advice about stored procedures and other server side code?

2016-12-28 Thread Christoph Moench-Tegeder
## Mike Sofen (mso...@runbox.com): > I look at this from the opposite direction: with a stable database > API (via stored procs), I can change the schema and logic within the > procs without causing any app code breakage…the app tier is completely > insulated from those changes – that’s worth a lo

Re: [GENERAL] LYDB: What advice about stored procedures and other server side code?

2016-12-29 Thread Christoph Moench-Tegeder
## Karsten Hilbert (karsten.hilb...@gmx.net): > > Many applications are not designed to have a "stable" database API. > It seems OP is arguing they should. Well, if the environment allows for that, fine. If not, well, duh. Regards, Christoph -- Spare Space -- Sent via pgsql-general mailing

Re: Ynt:[GENERAL] postgresql : could not serialize access due to read/write dependencies among transactions

2017-01-17 Thread Christoph Moench-Tegeder
## John R Pierce (pie...@hogranch.com): > that reason code doesn't sound like anything PostgreSQL generates. > SQLSTATE 40001 is "serialization_failure", but all that stuff about > 'identification as a pivot' ?that must be your ORM. That's PostgreSQL: https://wiki.postgresql.org/wiki/SSI Reg

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christoph Moench-Tegeder
## Christopher Molnar (cmolna...@gmail.com): > I have tried something like: > > update pcilms_assign set intro=regexp_replace(intro, '/([^/]*)\" title=$', > '&files=\1') where intro like '%https://owncloud.porterchester.edu%' and > course=18 and id=55413; http://blog.codinghorror.com/parsing-ht

Re: [GENERAL] Regex help again (sorry, I am bad at these)

2015-12-29 Thread Christoph Moench-Tegeder
## Melvin Davidson (melvin6...@gmail.com): > UPDATE pcilms_assign >SET intro = REPLACE (intro, 'HVACR1114_LAB_13A.pdf', > '&file=HVACR1114_LAB_13A.pdf') > WHERE intro like 'https://owncloud.porterchester.edu%' > AND course=18 and id=55413; Unfortunately, that tries to do the right th

Re: [GENERAL] Non-default postgresql.conf values to log

2016-04-07 Thread Christoph Moench-Tegeder
## Alex Ignatov (a.igna...@postgrespro.ru): > My question is: is there any option(s) to log non-default > postgresql.conf values to log file? Depending on your use case, I'd start with a simple query: SELECT name, setting FROM pg_settings WHERE source <> 'default' Wrap that in a COPY, or perhaps

Re: [GENERAL] Returning values from an array of JSONB objects.

2016-04-13 Thread Christoph Moench-Tegeder
## sighup (r...@sighup.eu): > How can I extract the value of the 'items' key either as two rows and or > a sum of both. select id, jsonb_array_elements(markers)->>'items' from data; And as jsonb_array_elements() returns a setof jsonb: with tab(id, items) as ( select id, (jsonb_array_elements(m

Re: [GENERAL] PostgreSQL with BDR - PANIC: could not create replication identifier checkpoint

2016-05-19 Thread Christoph Moench-Tegeder
## Cameron Smith (csm...@stereodllc.com): > t:2016-05-19 01:14:51.668 UTC d= p=144 a=PANIC: could not create replication > identifier checkpoint "pg_logical/checkpoints/8-F3923F98.ckpt.tmp": Invalid > argument > t:2016-05-19 01:14:51.671 UTC d= p=9729 a=WARNING: could not create > relation-ca

Re: [GENERAL] jsonb creation functions?

2014-08-01 Thread Christoph Moench-Tegeder
Hi, > There is a set of creation functions for json, such as: > > to_json(anyelement) > > There doesn't seem to be any equivalent functions for converting text to > jsonb. > > Is there a way to do this? You can always cast json to jsonb: test_db=# create table t (a integer primary key, b json

Re: [GENERAL] BDR DML Only

2014-09-15 Thread Christoph Moench-Tegeder
## p...@mailme.dk (p...@mailme.dk): > Is it already possible or would you consider a configuration option that > would only replicate DML but not DDL ? bdr.skip_ddl_replication = true can even be set at transaction level Regards, Christoph -- Spare Space -- Sent via pgsql-general mailing li

Re: [GENERAL] Memory Issue with array_agg?

2013-08-18 Thread Christoph Moench-Tegeder
## Robert Sosinski (rsosin...@ticketevolution.com): > When using array_agg on a large table, memory usage seems to spike up until > Postgres crashes with the following error: This sounds like bug #7916. http://www.postgresql.org/message-id/e1uceeu-0004hy...@wrigleys.postgresql.org As noted in tha

Re: [GENERAL] PostgreSQL on eMMC - Corrupt file system

2017-02-09 Thread Christoph Moench-Tegeder
## Thomas Güttler (guettl...@thomas-guettler.de): > Is running linux with postgres on eMMC a bad idea in general? I'd say that running anything with a read-write load on eMMC will end in pieces. It's ok to occasionally write something, but a mixed load is not really what these things were design

Re: [GENERAL] Query with type char

2017-02-16 Thread Christoph Moench-Tegeder
## Egon Frerich (e...@frerich.eu): > Why are there 0 rows? I expect 3 rows: >From your results I guess that sp3 IS NULL on the three rows where it is not 'j'. You should use the correct comparison predicate for this case, i.e. IS DISTINCT FROM instead of <>. https://www.postgresql.org/docs/9.6/st

Re: [GENERAL] How to define the limit length for numeric type?

2017-03-11 Thread Christoph Moench-Tegeder
## vod vos (vod...@zoho.com): > How to define the exact limit length of numeric type? For example, > > CREATE TABLE test (id serial, goose numeric(4,1)); > > 300.2 and 30.2 can be inserted into COLUMN goose, but I want 30.2 > or 3.2 can not be inserted, how to do this? testing=# CREATE TABLE

Re: [GENERAL] Where is the error?

2017-05-06 Thread Christoph Moench-Tegeder
## Igor Korot (ikoro...@gmail.com): > std::string query1 = "DECLARE alltables CURSOR SELECT > table_schema, table_name FROM information_schema.tables WHERE > table_type = 'BASE TABLE' OR table_type = 'VIEW' OR table_type = > 'LOCAL TEMPORARY';"; > [quote] > RROR: syntax error at or near "SEL

Re: [GENERAL] Where is the error?

2017-05-06 Thread Christoph Moench-Tegeder
## Igor Korot (ikoro...@gmail.com): > Another question - do I have to do "DECLARE CURSOR..." or I can just write > a normal SELECT query? > For this I followed and example on the libpg page... Yes. In fact, "libpq Example Program 3" on https://www.postgresql.org/docs/current/static/libpq-example.

Re: [GENERAL] Feature proposal, DBURL: psql pgsql://joe:p4zzw...@example.org:2345/dbname

2017-07-05 Thread Christoph Moench-Tegeder
## Hans Schou (hans.sc...@gmail.com): > Example of usage: > psql pgsql://joe:p4zzw...@example.org:2345/dbname Make the scheme "postgresql" and you're here: https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING "32.1.1.2. Connection URIs". Regards, Christoph -- Sp

Re: [GENERAL] What is the problem with this query?

2017-07-23 Thread Christoph Moench-Tegeder
## Igor Korot (ikoro...@gmail.com): > >> Is "IF" operator not supported by PostgreSQL > So how do I write this properly? There is documentation for that: https://www.postgresql.org/docs/current/static/sql-createindex.html Regards, Christoph -- Spare Space -- Sent via pgsql-general mailing l

Re: [GENERAL] Out of memory/corrupted shared memory problem on server

2017-08-25 Thread Christoph Moench-Tegeder
## Johann Spies (johann.sp...@gmail.com): > -- > 2017-08-24 19:23:26 SAST [7532-18] LOG: server process (PID 4890) was > terminated by signal 9: Killed That looks like out-of-memory. Check the kernel log/dmesg to verify. If it's the dreaded OOM-killer, you should check your over

Re: [GENERAL] Log shipping in v8.4.7

2017-08-27 Thread Christoph Moench-Tegeder
## Ron Johnson (ron.l.john...@cox.net): > Everything I've read says that you should use "rsync -a". Is there > any reason why we can't/shouldn't use "rsync -az" so as to reduce > transfer time? On today's LANs, total archiving time is dominated by connection startup time (how long does it take t

Re: [GENERAL] Log shipping in v8.4.7

2017-08-27 Thread Christoph Moench-Tegeder
## Ron Johnson (ron.l.john...@cox.net): > > On today's LANs, total archiving time is dominated by connection > > startup time (how long does it take to transfer 16MB on a 10GbE link? > > See...). > > And if we've only got a WAN link from one DC to another 360 miles away? Well... TCP handshake wi

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Christoph Moench-Tegeder
## Ron Johnson (ron.l.john...@cox.net): > How is this done in v8.4? (I tried adding "date; rsync ..." but pg > didn't like that *at all*.) There's a DEBUG1-level log message on successful archive_command completion - that would give you a lot of other low-prio log messages wich you probably don'

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Christoph Moench-Tegeder
## Stephen Frost (sfr...@snowman.net): > Worse, such scripts run the serious risk of losing WAL if a crash > happens because nothing is ensuring that the WAL has been sync'd to disk > before returning from the archive_command. That risk already exists when using rsync/scp/scp/... and should be mi

Re: [GENERAL] Logging the fact that a log was shipped

2017-08-28 Thread Christoph Moench-Tegeder
## Ron Johnson (ron.l.john...@cox.net): > > I'd put a wrapper around your rsync (a short shell script > > would be sufficient) in the lines of rsync ... && logger "done", > > that way you'd get the information via syslog. > > And if logging to stderr? In that case your original approach could ha

Re: [GENERAL] Need help with Inet type

2013-09-10 Thread Christoph Moench-Tegeder
## Eric Lamer (eric.la...@intact.net): > I can do something like: > >Select * From logs Where src_ip IN (Select ip from ip_table where zone > = 'ZONE_a'); > >Of course that does not work since it does not work with Inet type and > I cannot use << because I have more than 1 row return