Re: [External] Re: postgresql-11 installation errors via deb package on ubuntu 16

2019-03-18 Thread Adrian Klaver
On 3/18/19 7:49 AM, Vijaykumar Jain wrote: Thanks Tom, I probably thought it was not the right forum, but thanks for being polite and saying no. Given that you are using the PGDG packages I would consider this the correct list. I just wanted to take a chance if this was known to anyone, co

Re: printing JsonbPair values of input JSONB on server side?

2019-03-18 Thread Andrew Gierth
> "T" == T L writes: T> Below is my test. It prints a strange character instead of "a"; and T> says that the value isn't numeric. Yeah, there's plenty else wrong with your code. Did you look at how JsonbToCStringWorker does it? that looks like the best example I can find on a quick scan.

Re: printing JsonbPair values of input JSONB on server side?

2019-03-18 Thread T L
My fault on the first line. You are right. The value type isn't actually numeric. I changed the problem lines to: //problem lines!!! //either elog crashes pg server char *buf = pnstrdup(ptr->key.val.string.val, ptr->key.val.string.len); elog(NOTICE, "print_kv_pair(): k = %

Re: printing JsonbPair values of input JSONB on server side?

2019-03-18 Thread Andrew Gierth
> "T" == T L writes: T> //problem lines!!! //either elog crashes pg server T> char *buf = pnstrdup(ptr->key.val.string.val, T> ptr-> key.val.string.len); T> elog(NOTICE, "print_kv_pair(): k = %s", T> (ptr->key).val.string.val); //debu

Re: Facing issue in using special characters

2019-03-18 Thread Peter J. Holzer
On 2019-03-17 15:01:40 +, Warner, Gary, Jr wrote: > Many of us have faced character encoding issues because we are not in control > of our input sources and made the common assumption that UTF-8 covers > everything. UTF-8 covers "everything" in the sense that there is a round-trip from each ch

Re: printing JsonbPair values of input JSONB on server side?

2019-03-18 Thread T L
Thanks a lot for the suggestions. I changed the code below (with `pnstrdup` and `DatumGetCString`). But the code still crashes at the two problem lines (either one alone crashes the server). The input is: select print_kv_pair('{"a":1, "b": 2}'); Any further insight? -- modified code -- PG_FUNC

Re: printing JsonbPair values of input JSONB on server side?

2019-03-18 Thread Andrew Gierth
> "T" == T L writes: T> //Problem line!!! T> //elog(NOTICE, "print_kv_pair(): k = %s, v = %s", T> ptr-> key.val.string.val, numeric_out(ptr->value.val.numeric)); string.val isn't a C string (notice the "not null terminated" comment in the structure definition), an

printing JsonbPair values of input JSONB on server side?

2019-03-18 Thread T L
Hi, I am trying to write a PostgreSQL (11.2) server side function to read the key-value pairs of an input JSONB object. The code I have assembled so far (by mimicking existing code I can find) is below. (This is the closest thing I can find/write, and I couldn't find any documentation by the way.)

SV: Permission to refresh materialized view

2019-03-18 Thread Gustavsson Mikael
>From documentation: "REFRESH MATERIALIZED VIEW completely replaces the contents of a materialized view. To execute this command you must be the owner of the materialized view." So it is intended behavior. https://www.postgresql.org/docs/11/sql-refreshmaterializedview.html ___

Re: minio server. Was: Performance of ByteA: ascii vs binary

2019-03-18 Thread Adrian Klaver
On 3/18/19 7:59 AM, Thomas Güttler wrote: Am 18.03.19 um 15:49 schrieb Tom Lane: Adrian Klaver writes: On 3/18/19 7:33 AM, Thomas Güttler wrote: If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. This doesn't seem terribly surprising in

Re: Camel case identifiers and folding

2019-03-18 Thread Rob Sargent
On 3/18/19 5:18 AM, Morris de Oryx wrote: Sounds like I may have touched a nerve with some. If so, no offense intended! There are cases where case-sensitivity is required or desirable, it would be silly to argue otherwise. Where you have such cases, then case-sensitive queries are great. Som

minio server. Was: Performance of ByteA: ascii vs binary

2019-03-18 Thread Thomas Güttler
Am 18.03.19 um 15:49 schrieb Tom Lane: Adrian Klaver writes: On 3/18/19 7:33 AM, Thomas Güttler wrote: If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. This doesn't seem terribly surprising in bytea_output = escape mode. Probably wit

Re: Permission to refresh materialized view

2019-03-18 Thread Adrian Klaver
On 3/17/19 11:52 PM, Johann Spies wrote: Please reply to list also. Ccing list. On Wed, 13 Mar 2019 at 16:24, Adrian Klaver > wrote: On 3/13/19 6:27 AM, Johann Spies wrote: ... > But user Y gets the message that he has to be the owner of a >

Re: [External] Re: postgresql-11 installation errors via deb package on ubuntu 16

2019-03-18 Thread Vijaykumar Jain
Thanks Tom, I probably thought it was not the right forum, but thanks for being polite and saying no. I just wanted to take a chance if this was known to anyone, coz googling did not show recent issues with the same. But ok, I'll ask in ubuntu forums. Regards, Vijay On Mon, Mar 18, 2019 at 8:15

Re: Performance of ByteA: ascii vs binary

2019-03-18 Thread Tom Lane
Adrian Klaver writes: > On 3/18/19 7:33 AM, Thomas Güttler wrote: >> If I used ascii data the tests took 52 seconds. >> If I used random binary data the test took 250 seconds. This doesn't seem terribly surprising in bytea_output = escape mode. Probably with bytea_output = hex the performance wo

Re: [External] Re: postgresql-11 installation errors via deb package on ubuntu 16

2019-03-18 Thread Vijaykumar Jain
uname -a Linux 4.4.0-116-generic #140-Ubuntu SMP Mon Feb 12 21:23:04 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux lsb_release -a Distributor ID: Ubuntu Description:Ubuntu 16.04.4 LTS Release:16.04 Codename: xenial no, these fresh installations. existing installations do not have iss

Re: postgresql-11 installation errors via deb package on ubuntu 16

2019-03-18 Thread Tom Lane
Vijaykumar Jain writes: > I do not know if this list is also for asking ubuntu package related queries. Not really; you'd be better off filing a bug with ubuntu where their packager(s) will see it. The symptoms you describe definitely look like there is something wrong with a packager-supplied c

Re: Performance of ByteA: ascii vs binary

2019-03-18 Thread Adrian Klaver
On 3/18/19 7:33 AM, Thomas Güttler wrote: I did some benchmarking and in my setup there was major performance difference. I tested a ByteA column. What was the test? If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. binary data is (roug

Re: postgresql-11 installation errors via deb package on ubuntu 16

2019-03-18 Thread Adrian Klaver
On 3/18/19 7:24 AM, Vijaykumar Jain wrote: Hey Guys, I do not know if this list is also for asking ubuntu package related queries. We have been recently getting a lot of below errors, as a result of which the entire postgresql installation gets broken. the config folder /etc/postgresql/* is emp

Performance of ByteA: ascii vs binary

2019-03-18 Thread Thomas Güttler
I did some benchmarking and in my setup there was major performance difference. I tested a ByteA column. If I used ascii data the tests took 52 seconds. If I used random binary data the test took 250 seconds. binary data is (roughly) five times slower than ascii data? Is this a know fact, or i

postgresql-11 installation errors via deb package on ubuntu 16

2019-03-18 Thread Vijaykumar Jain
Hey Guys, I do not know if this list is also for asking ubuntu package related queries. We have been recently getting a lot of below errors, as a result of which the entire postgresql installation gets broken. the config folder /etc/postgresql/* is empty, initdb fails to initialize the db and we

Re: Camel case identifiers and folding

2019-03-18 Thread Thomas Kellerer
Chris Travers schrieb am 18.03.2019 um 13:16: > MySQL also ignores the standard and does not fold cases. Unless you configure it to fold to lowercase. Which in turn is a cure for the fact, that case-sensitivity of table names depends on the case-sensitivity of the underlying file system (not th

Re: Fwd: Camel case identifiers and folding

2019-03-18 Thread Chris Travers
On Sat, Mar 16, 2019 at 3:15 PM Tom Lane wrote: > Steve Haresnape writes: > > As I said, I don't want to quote my identifiers. I know what that does. I > > want to specify them in a certain way, see them in that same way, but > refer > > to them in any old way. > > You can call it normalize or f

Re: Camel case identifiers and folding

2019-03-18 Thread Chris Travers
On Thu, Mar 14, 2019 at 11:07 PM Steve Haresnape < s.haresn...@creativeintegrity.co.nz> wrote: > I'm porting a sql server database to postgresql 9.6. My camelCase > identifiers are having their humps removed. This is disconcerting and sad. > > Is there a cure for this? > Double quote them. > > I

Re: Camel case identifiers and folding

2019-03-18 Thread Morris de Oryx
...hit send by accident ..or BLACK SHOULDERED KITE You'll see all three regularly, depending on context and writer. It's always the same bird. A natural search turns up all matches, regardless of capitalization differences. The hyphens are hardI'm a huge, huge, huge fan of fuzzy string matchi

Re: Camel case identifiers and folding

2019-03-18 Thread Morris de Oryx
Sounds like I may have touched a nerve with some. If so, no offense intended! There are cases where case-sensitivity is required or desirable, it would be silly to argue otherwise. Where you have such cases, then case-sensitive queries are great. Some RDBMS systems default to case-sensitive search

Re: s3 was: Where to store Blobs?

2019-03-18 Thread Karsten Hilbert
On Mon, Mar 18, 2019 at 11:42:00AM +0100, Thomas Güttler wrote: > I am curious. Why did nobody say: > > store blobs in a storage server (like s3) and only store the blob-id in > PostgreSQL? That's been rehashed to the point of becoming a FAQ https://wiki.postgresql.org/wiki/BinaryFile

s3 was: Where to store Blobs?

2019-03-18 Thread Thomas Güttler
I am curious. Why did nobody say: store blobs in a storage server (like s3) and only store the blob-id in PostgreSQL? Regards, Thomas Am 13.03.19 um 15:28 schrieb Thomas Güttler: Some days ago I asked "Where **not** to use PostgreSQL?" on this mailing list. Now I realized: Nobody talked