Re: [GENERAL] EXCLUDE, Gist and integers

2015-07-15 Thread Ken Tanzer
On Wed, Jul 15, 2015 at 10:03 PM, Guillaume Lelarge wrote: > Hi, > > Le 16 juil. 2015 2:23 AM, "Ken Tanzer" a écrit : > > > > Hi. I'm looking into adding daterange exclusions to some of my tables. > Following the documentation, I can do this no problem to prevent any > records from overlapping:

Re: [GENERAL] EXCLUDE, Gist and integers

2015-07-15 Thread Guillaume Lelarge
Hi, Le 16 juil. 2015 2:23 AM, "Ken Tanzer" a écrit : > > Hi. I'm looking into adding daterange exclusions to some of my tables. Following the documentation, I can do this no problem to prevent any records from overlapping: > > CREATE TEMP TABLE foo ( > client_id integer, > start_date date NO

Re: [GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Tom Lane
Ronald Peterson writes: > This does work for strings that don't contain consecutive zeroes. I'm not > really passing the string to PostgreSQL, but to Net::LDAP, but it must hit > PostgreSQL anyway? Active Directory requires this encoding, so I'm not > sure what to do here. Hm, well, the concret

[GENERAL] EXCLUDE, Gist and integers

2015-07-15 Thread Ken Tanzer
Hi. I'm looking into adding daterange exclusions to some of my tables. Following the documentation, I can do this no problem to prevent any records from overlapping: CREATE TEMP TABLE foo ( client_id integer, start_date date NOT NULL, end_date date, EXCLUDE using gist (daterange(start_dat

Re: [GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Ronald Peterson
Thanks Pavel, this looks promising. I didn't know about the Data::Peek module - that might help me figure out what is going on. On Wed, Jul 15, 2015 at 2:28 PM, Pavel Stehule wrote: > > > 2015-07-15 20:20 GMT+02:00 Ronald Peterson : > >> That's interesting. What I'm really doing, instead of th

Re: [GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Pavel Stehule
2015-07-15 20:20 GMT+02:00 Ronald Peterson : > That's interesting. What I'm really doing, instead of the second elog > statement, is this: > > $ret = $ldap->modify( $dn, > replace => { > unicodePwd => $mspass > } ); > > This does wo

Re: [GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Ronald Peterson
That's interesting. What I'm really doing, instead of the second elog statement, is this: $ret = $ldap->modify( $dn, replace => { unicodePwd => $mspass } ); This does work for strings that don't contain consecutive zeroes. I'm not

Re: [GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Daniel Verite
Ronald Peterson wrote: > # select * from doublezero(); > INFO: double00 > CONTEXT: PL/Perl function "doublezero" > ERROR: invalid byte sequence for encoding "UTF8": 0x00 at line 8, > line 558. > CONTEXT: PL/Perl function "doublezero" > > I don't understand this. I need to pass $mspa

Re: [GENERAL] [9.5] question about row level security

2015-07-15 Thread Charles Clavadetscher
Hello I am not so sure if this is feasible with policies only. Personally I would separate private data from the rest assuming that that part is anyway information that also the boss is not supposed to look at. A separation would make the setup of policies easy. Using the structure that you

Re: [GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Adrian Klaver
On 07/15/2015 07:14 AM, Ronald Peterson wrote: The following short function illustrates a problem I'm having with the plperlu module. CREATE OR REPLACE FUNCTION doublezero () RETURNS VOID AS $$ use Encode qw/encode decode/; $pass = "double00"; elog( INFO, "$pass" ); $mspass = encode( 'UTF-16LE',

[GENERAL] utf8 encoding problem with plperlu

2015-07-15 Thread Ronald Peterson
The following short function illustrates a problem I'm having with the plperlu module. CREATE OR REPLACE FUNCTION doublezero () RETURNS VOID AS $$ use Encode qw/encode decode/; $pass = "double00"; elog( INFO, "$pass" ); $mspass = encode( 'UTF-16LE', qq("$pass") ); elog( INFO, "$mspass" ); $$ LANGU

Re: [GENERAL] could not create shared memory segment: Invalid argument

2015-07-15 Thread Ryan King - NOAA Affiliate
I tried that too - same result. I updated another box w/ the same issue to 9.4.4, and all is well there. Thanks for your reply. On Tue, Jul 14, 2015 at 8:59 AM, Andy Colson wrote: > On 7/13/2015 7:08 PM, Ryan King - NOAA Affiliate wrote: > >> Apologies ahead of time for not knowing which group t

Re: [GENERAL] Creating table with data from a join

2015-07-15 Thread Marc Mamin
> Marc, I am using postgres 9.4. I didn't benchmark, but intuitively the modulo > operator will force traversing every record in table "a" 4 times, as it can't > use an index. Not necessarily. seq scans can be synchronized: "This allows sequential scans of large tables to synchronize with each

Re: [GENERAL] unexpected data beyond EOF in block 260 of relation pg_tblspc

2015-07-15 Thread Adrian Klaver
On 07/15/2015 02:54 AM, Mitu Verma wrote: Just to add few more words to the queries mentioned below - _ *From:* Mitu Verma *Sent:* July 15, 2015 11:15 AM *To:* 'pgsql-general@postgresql.org' *Subject:* RE: unexpected data beyond EOF in block 260 of rela

Re: [GENERAL] Creating table with data from a join

2015-07-15 Thread Igor Stassiy
David, I did something like this: psql -f /dev/fd/3 3 << IN1 & psql -f /dev/fd/4 4 << IN2 ... INSERT INTO c SELECT * FRO a JOIN b ON a.ad=b.id WHERE a.id < 0.25th quantile IN1 INSERT INTO c SELECT * FRO a JOIN b ON a.ad=b.id WHERE a.id < 0.5th quantile AND a.id >= 0.25th quantile IN2 ... IN3 ...

Re: [GENERAL] unexpected data beyond EOF in block 260 of relation pg_tblspc

2015-07-15 Thread Mitu Verma
Just to add few more words to the queries mentioned below - _ From: Mitu Verma Sent: July 15, 2015 11:15 AM To: 'pgsql-general@postgresql.org' Subject: RE: unexpected data beyond EOF in block 260 of relation pg_tblspc Hi team, kindly help me with the

Re: [GENERAL] could not fork new process for connection: Resource temporarily unavailable

2015-07-15 Thread Albe Laurenz
Jimit Amin wrote: > I have heavy transaction load production database 9.3 PPAS .Today Database is > not able to give new > process. I checked pg_stat_activity , there are so many transaction in > waiting stage because of one > procedure and lock on one table (Code inside procedure) [...] > co

[GENERAL] [9.5] next question: rls and indexes

2015-07-15 Thread Andreas Kretschmer
hi @ll, my table: test=*# \d rls_test Table "public.rls_test" Column | Type | Modifiers +-+--- id | integer | name | text| txt| text| Indexes: "idx_name" btree (name) Policies: POLICY "my_policy" FOR ALL USING (name = ("current_u

[GENERAL] [9.5] question about row level security

2015-07-15 Thread Andreas Kretschmer
Hello @ll, how can i define a policy to prevent update a single field but enable update other fields in a row? For instance, a staff member table. the boss should be able to change all fields but not a specific field in all rows, but should be able to update this field for his own row. id | name