[GENERAL] Different query plans using different roles

2016-06-27 Thread Charles
2022,182103,182119,182220,182239,182332,182588,182589,182629,182655}'::bigint[])) -> Seq Scan on wsndata n (cost=0.00..22437445.52 rows=1477767 width=18) Filter: ((item = 3501) AND ((freq)::text = 'A'::text)) (13 rows) I am quite perplexed, why is this happening? postgresql-server version: 9.5.2 Best Charles

[GENERAL] running postgresql

2007-11-05 Thread Charles
I am running Gutsy (Ubuntu 7.10) and new to Postgresql. I followed the direction at https://help.ubuntu.com/community/PostgreSQL. I executed the following commands: sudo -u postgres createuser -D -A -P myuser sudo -u postgres createdb -O myuser mydb [EMAIL PROTECTED]:~$ psql

[GENERAL] postgresql startup

2007-12-08 Thread Charles
d! Thanks. Charles ---(end of broadcast)--- TIP 6: explain analyze is your friend

[GENERAL] Prevent roles not having admin option from granting themselves to other roles

2015-06-11 Thread Charles Clavadetscher
grant specific privileges it has, but allow it to grant all privileges at once, granting itself as a role? Now consider this case to illustrate what I mean: Create a test environment: charles@admin.localhost=# CREATE ROLE user1 LOGIN PASSWORD 'xxx'; charles@admin.localhost=# CREATE ROLE

Re: [GENERAL] Prevent roles not having admin option from granting themselves to other roles

2015-06-11 Thread Charles Clavadetscher
st could have a technical solution. Regards Charles >See here: > >http://www.postgresql.org/docs/9.4/interactive/sql-createrole.html > >In particular the section on INHERIT and in NOTES this: > >"The INHERIT attribute is the default for reasons of backwards >compatibi

Re: [GENERAL] Prevent roles not having admin option from granting themselves to other roles

2015-06-11 Thread Charles Clavadetscher
r privileges granted directly (apart from connect to database) to avoid switching between group and user. Well at least where I am it is getting late and I guess I can use some fresh air. Regards Charles -Original Message- From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow..

Re: [GENERAL] Trying to avoid a simple temporary variable declaration in a pl/pgsql function

2015-06-20 Thread Charles Clavadetscher
values (2,'Text 2'); CREATE FUNCTION test_func() RETURNS text LANGUAGE 'plpgsql' AS $$ BEGIN RETURN (SELECT what_goes_here FROM test LIMIT 1); END; $$; SELECT * FROM test_func(); test_func --- Text 1 (1 row) No need for INTO. Bye Charles On 6/20/2015 17:07, David

Re: [GENERAL] INSERT a number in a column based on other columns OLD INSERTs

2015-06-20 Thread Charles Clavadetscher
not seem to play a role, but the correct version is as mentioned := Bye Charles On 6/20/2015 21:37, Bill Moran wrote: On Sat, 20 Jun 2015 10:44:21 -0700 (MST) litu16 wrote: In PostgreSQL I have this table... (there is a primary key in the most left side "timestamp02" which is no

Re: [GENERAL] INSERT a number in a column based on other columns OLD INSERTs

2015-06-21 Thread Charles Clavadetscher
and return the modified record. Now the insert is done as usual using the NEW record returned by the trigger function. Bye Charles On 6/21/2015 03:07, litu16 wrote: Hi, thanks yes I was using AFTER, but it only works with BEFORE so finally I got it to work. thanks to all Im just still wondering

Re: [GENERAL] INSERT a number in a column based on other columns OLD INSERTs

2015-06-21 Thread Charles Clavadetscher
efore" triggers. I would recommend you to read the documentation on trigger functions. It is excellent and clarifies quite a lot how things work. Bye Charles On 6/21/2015 16:49, Charles Clavadetscher wrote: Hi The two things have nothing in common. With NEW.time_index = t_ix you set the fi

Re: [GENERAL] create index on a field of udt

2015-06-28 Thread Charles Clavadetscher
Hello I am not sure it is that simple. Probably you need to create operator classes to be used for indexing. http://www.postgresql.org/docs/9.4/static/xtypes.html You are probably better off using the basic data type in your table and using a composite index. Bye Charles

Re: [GENERAL] create index on a field of udt

2015-06-29 Thread Charles Clavadetscher
+1 create index on test (((i).id)); ANALYZE explain select * from test where (i).id = 8909; QUERY PLAN - Index Scan using test_id_idx on test (cost=0.43..8.45 rows=1 width=34) Index

Re: [GENERAL] Ubuntu 14.04 LTS install problem

2015-07-01 Thread Charles Clavadetscher
Hello Urs I could install PostgreSQL 9.4 on Ubuntu 14.04 without adding repositories (actually it was an upgrade and I had to move the data manually from 9.3 to 9.4). You may want to try it that way? Bye Charles > -Original Message- > From: pgsql-general-ow...@postgres

Re: [GENERAL] Ubuntu 14.04 LTS install problem

2015-07-01 Thread Charles Clavadetscher
I need to check that when I get home. Suddendly I have the impression that I may have added a repository to check 9.4 before it was released. I will get back at that if nobody else can offer a solution, but it may take some time. Bye Charles > -Original Message- > From: pgsql-g

Re: [GENERAL] Download PostgreSQL 9.5 Alpha

2015-07-03 Thread Charles Clavadetscher
that if I hadn't had 9.4 already on the system apt-get would have worked. The error message suggested that it did not want to replace some existing files (e.g. libpq if I remember well). I assumed that this was intended to avoid a working version to be "damaged". Bye Charles

Re: [GENERAL] String match function required like utl_match in oracle

2015-07-04 Thread Charles Clavadetscher
Or maybe even better: http://www.postgresql.org/docs/9.4/static/fuzzystrmatch.html Search for Levenshtein. Bye Charles On 7/4/2015 11:50, Jimit Amin wrote: Hello, I want to compare 2 string and want result like how much percentage or how much part string is compared. Can I know any option

Re: [GENERAL] [pg_hba.conf] publish own Python application using PostgreSQL

2015-07-05 Thread Charles Clavadetscher
to install applications that change settings in pg_hba.conf on my server. Besides you may consider limiting the trust access to the specific user and specific database that your application needs to access. Bye Charles On 7/5/2015 12:15, c.bu...@posteo.jp wrote: I have my own Python applicati

[GENERAL] Row level security - notes and questions

2015-07-10 Thread Charles Clavadetscher
sting how to solve the problem. What I don't know or don't understand is the following: - Why is there not a consistent policy violation message when one would apply as mentioned above? - Why is the WITH CHECK condition only used on the values in the new record in the case of an update? Thank you. Charles -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Row level security - notes and questions

2015-07-11 Thread Charles Clavadetscher
continue with some experiments and get back with new questions if any arise. PostgreSQL has really a great community ;-) Enjoy Charles > -Original Message- > From: Stephen Frost [mailto:sfr...@snowman.net] > Sent: Samstag, 11. Juli 2015 15:22 > To: Charles Clavadetscher > Cc

Re: [GENERAL] A table of magic constants

2015-07-11 Thread Charles Clavadetscher
eaning. Maybe it helps. Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Dane Foster Sent: Samstag, 11. Juli 2015 22:56 To: Adrian Klaver Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] A table of magic constants Hello

[GENERAL] Where to place suggestions for documentation improvements

2015-07-14 Thread Charles Clavadetscher
Hello I have a generic question. Where should I/we place suggestions on possible improvements of the documentation? Is it here or better on pgsql-docs? Thanks Charles -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http

Re: [GENERAL] Where to place suggestions for documentation improvements

2015-07-14 Thread Charles Clavadetscher
Thank you Michael I will post my suggestions on pgsql-docs to make sure ;-) Bye Charles > -Original Message- > From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general- > ow...@postgresql.org] On Behalf Of Michael Paquier > Sent: Dienstag, 14. Juli 2015 14:21 &

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

2015-07-15 Thread Charles Clavadetscher
;boss changed' WHERE name = 'boss'; UPDATE 1 But he can change his own col_privat. boss=> SELECT * FROM staff; id | name | boss | col1 | col_privat +--+--+--+-- 2 | joe | boss | 20 | joe privat 3 | sue | boss | 250 | sue changed 1

Re: [GENERAL] INSERT ... ON CONFLICT DO UPDATE

2015-07-19 Thread Charles Clavadetscher
me to critics it received. > > If not: is it unreasonable? why? IMHO, as I mentioned, this is not an UPSERT use case, but maybe the implementors of the feature may have different arguments. You could implement that in a function instead of the application, if you prefer. Bye Charles -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Problem with pl/python procedure connecting to the internet

2015-08-22 Thread Charles Clavadetscher
indication "survice unknown" seems to point to an error in the URL and not to an authorization problem. Maybe some encoding problem? The irritating thing is that you mention that it works sometimes and sometimes not. Getting back to the encoding problem idea, is there a differe

Re: [GENERAL] Problem with pl/python procedure connecting to the internet

2015-08-23 Thread Charles Clavadetscher
lyze the problem could be to sniff the network traffic and see what really happens when you make the function call. This could help at least to discard network problems and may lead to some useful information. I hope that you will find a solution. Bye Charles -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] Strange TRIGGER failure with FOR ... IN ... LOOP ... INSERT

2015-08-27 Thread Charles Clavadetscher
plpgsql VOLATILE; Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Christopher BROWN Sent: Donnerstag, 27. August 2015 13:50 To: pgsql-general@postgresql.org Subject: [GENERAL] Strange TRIGGER failure with FOR ... IN ... LOOP

Re: [GENERAL] Strange TRIGGER failure with FOR ... IN ... LOOP ... INSERT

2015-08-27 Thread Charles Clavadetscher
: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Charles Clavadetscher Sent: Donnerstag, 27. August 2015 14:57 To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Strange TRIGGER failure with FOR ... IN ... LOOP ... INSERT Hello You declare your

Re: [GENERAL] Strange TRIGGER failure with FOR ... IN ... LOOP ... INSERT

2015-08-27 Thread Charles Clavadetscher
ERAL] Strange TRIGGER failure with FOR ... IN ... LOOP ... > INSERT > > On 08/27/2015 06:33 AM, Christopher BROWN wrote: > > Hello Adrian, > > > > Yep, Charles' explanation helped me understand what was going on. > > Before that, I was as confused as you were (i

Re: [GENERAL] Need Database Backup

2015-08-30 Thread Charles Clavadetscher
um or mailing list. - If you have produced a SQL file dumping your whole clusterv (pg_dumpall), then you should only need to reinstall PostgreSQL and run the file as a script (from command line or psql). There is no upload of sql file, unless I don't understand what you mean. Bye Charles F

Re: [GENERAL] Need Database Backup

2015-08-30 Thread Charles Clavadetscher
Well the rest should be easy. psql -U ... -h ... -p ... -d ... -f sql_file.sql http://www.postgresql.org/docs/9.4/static/app-psql.html option "f" From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Melvin Davidson Sent: Sonntag, 30. August 2015 16:2

Re: [GENERAL] Public facing PostgreSQL hosting ?

2015-08-31 Thread Charles Clavadetscher
://www.postgresql.org/docs/9.4/interactive/client-authentication.html A tool I heard about, but never used is phpPgAdmin. You may want to take a look: http://phppgadmin.sourceforge.net/doku.php Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On

[GENERAL] BDR problem

2015-09-11 Thread Charles Lynch
-j4 -s all && make install" then init the db and set everything with config, ssl certs, and cluster creation and joining. Any help on this would be really appreciated. Thanks guys Charles

Re: [GENERAL] Delete trigger

2015-09-18 Thread Charles Clavadetscher
Hello Not sure I get it right, but all three fields are not nullable. So they will always have a value, which is what I understand of "are specified". What do you need the trigger for in that case? Bye Charles > -Original Message- > From: pgsql-general-ow..

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Charles Clavadetscher
elp: kofadmin@kofdb.localhost=> SET datestyle TO 'ISO'; SET kofadmin@kofdb.localhost=> select now(); now 2015-09-22 12:53:38.123+02 (1 row) If you want the change to be persistent you can use: ALTER DATABASE database_name SET datestyle TO &#

Re: [GENERAL] how to show time zone with numerical offset in CSV log?

2015-09-22 Thread Charles Clavadetscher
2.09.2015 15:53:50.44 CEST db=> SET datestyle TO "ISO"; SET db=> \copy testdate to testdate.csv csv header ; COPY 3 Content of file: timedate 2015-09-22 15:53:48.268+02 2015-09-22 15:53:49.612+02 2015-09-22 15:53:50.44+02 So it is actually a matter of instructing the client to

Re: [GENERAL] Selecting pairs of numbers

2015-10-05 Thread Charles Clavadetscher
> aklaver@test=> create table pr_test(x int, y int); > > aklaver@test=> select * from pr_test where (x, y) between (1, 3) and > (3,2) order by x,y; > x | y > ---+--- > 1 | 3 > 1 | 4 > 2 | 1 > 2 | 2 > 2 | 3 > 2 | 4 > 3 | 1 > 3 | 2 +1, nice. -- Sent via pgsql-general mailing

Re: [GENERAL] Unable to select a table as postgres user

2015-10-30 Thread Charles Clavadetscher
Hi What error do you get? - Permission denied or table does not exist? Latter would indicate a problem with the search_path and you should fully qualify the table name in the function body. - Did you create the function as postgres user? Bye Charles On 30/10/2015 07:56, rajan wrote: Yes

Re: [GENERAL] Selectively Importing Data

2015-10-31 Thread Charles Clavadetscher
this is not the case. Bye Charles > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Raymond O'Donnell > Sent: Samstag, 31. Oktober 2015 12:42 > To: David Blomstrom ; pgsql-general@postgres

Re: [GENERAL] How SQL SELECT * statement works in Postgres?

2016-06-05 Thread Charles Clavadetscher
a good start: https://www.postgresql.org/docs/9.5/static/overview.html Regards, Charles Regards, SSR -- Charles Clavadetscher Swiss PostgreSQL Users Group http://www.swisspug.org http://www.pg

Re: [GENERAL] Running query without trigger?

2016-07-08 Thread Charles Clavadetscher
the bulk update from a record field, e.g. a timestamp or something like this, you may use WHEN to exclude them from firing the trigger. I am not sure if it is possible to use a condition other than using the fields of the old or new record. https://www.postgresql.org/docs/current/static

Re: [GENERAL] Database Architect - Voleon Capital Management LP

2016-07-14 Thread Charles Weitzer
Yes. I was advised of that. Sorry for the mistake. Charles Weitzer Senior Recruiter The Voleon Group char...@voleon.com Office: 510.704.9870 x 7012 Mobile: (510) 558-9182 www.voleon.com Confidential: This e-mail may contain confidential and/or privileged information. If you are not the

Re: [GENERAL] For storing XML version in our table.

2016-07-22 Thread Charles Clavadetscher
data with their version in postgres database table. You can start reading here for the current version (9.5 at the time of this writing): https://www.postgresql.org/docs/current/static/datatype-xml.html https://www.postgresql.org/docs/current/static/functions-xml.html Regards Charles --

Re: [GENERAL] Array value from table as parameter

2016-07-22 Thread Charles Clavadetscher
erts {} values back to [] without treat > it as a string and use replace, what I think that is not the ideal solution because it may can't satisfy more complex arrays. Would it help to simply cast the argument to TEXT[]? select function_x(1,55,(new.situations)::TEXT[]); I am not sure

Re: [GENERAL] Proposal "stack trace" like debugging option in PostgreSQL

2016-08-01 Thread Charles Clavadetscher
ll Stack --- PL/pgSQL function inner_func() line 5 at GET DIAGNOSTICS PL/pgSQL function outer_func() line 3 at RETURN CONTEXT: PL/pgSQL function outer_func() line 3 at RETURN outer_func 1 (1 row) Regards Charles -- Swiss PostgreS

Re: [GENERAL] Log all queries before migration ?

2016-08-03 Thread Charles Clavadetscher
ble. This may help you? http://laurenz.github.io/pgreplay/ Regards Charles > > When I log, I see this kind of queries : > "duration: 0.046 ms parse : UPDATE user SET money = money + $1 > WHERE id = $2" > > But I would like to have only : "UPDATE u

Re: [GENERAL] Extract data from JSONB

2016-08-07 Thread Charles Clavadetscher
| true admin| true accounts | true contacts | true (5 rows) or select key, (value::json)->'status' from jsonb_each( '{ "accounts": {"status": true}, "admin":{"status": true}, "calendar": {"status": false}, "ch

Re: [GENERAL] lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux

2016-08-08 Thread Charles Clavadetscher
d to database "kofdb" as user "kofadmin". kofadmin@kofdb.localhost=> select lower('И'); <-- This works on a DB with another collation and ctype lower --- и (1 row) It seems to be a problem with collation and or ctype. What are the settings of the

Re: [GENERAL] lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux

2016-08-08 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Charles > Clavadetscher > Sent: Montag, 8. August 2016 09:30 > To: 'Alexander Farber' ; 'pgsql-general' > > Subje

Re: [GENERAL] lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux

2016-08-08 Thread Charles Clavadetscher
llate "en_US")) ; lower --- и (1 row) Maybe other more expert than me on this topic will suggest better solution. Bye Charles -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [GENERAL] lower() silently fails for 9.5.3 on Windows, but works on Mac, Linux

2016-08-08 Thread Charles Clavadetscher
.3 on Windows, but works > on Mac, Linux > > Hello Charles, unfortunately on Windows 7 this fails: > > psql (9.5.3) > Type "help" for help. > > # select lower(('И'::text collate "en_US")) ; > ERROR: collation "en_US" for enc

Re: [GENERAL] RETURNS TABLE function: ERROR: column reference "word" is ambiguous

2016-08-10 Thread Charles Clavadetscher
> > > How to resolve this "naming conflict" best or maybe there is some better way > like using some "internal" table > implicitly created by the type declaration? > > > Thank you > > Alex > > > P.S. Below is my full source code and the full log ou

Re: [GENERAL] Upgrading using pg_dumpall

2016-09-03 Thread Charles Clavadetscher
: password authentication failed for user "rshepard" Does the user rshepard exist in the new 9.5 instance? What was the error message? As above. Thanks, Rich -- Swiss PostgreSQL Users Group c/o Charles Clavadetscher Treasurer Motorenstrasse 18 CH – 8005 Zü

Re: [GENERAL] Upgrading using pg_dumpall

2016-09-04 Thread Charles Clavadetscher
ion failed for user "rshepard" Well, there you have it. As Adrian suggested you may set temporarily the authentication method to trust, set yourself a password and change it back to md5. That should do. Bye Charles The crm database is owned by me. I have never used it, but I am

Re: [GENERAL] Upgrading using pg_dumpall

2016-09-04 Thread Charles Clavadetscher
already answered that. You can set the connection authentication method to trust. This can have some risks, however. Bye Charles Thanks again, Rich -- Swiss PostgreSQL Users Group c/o Charles Clavadetscher Treasurer Motorenst

Re: [GENERAL] Upgrading using pg_dumpall

2016-09-04 Thread Charles Clavadetscher
Hi On 09/04/2016 05:16 PM, Charles Clavadetscher wrote: Hi On 09/04/2016 05:14 PM, Rich Shepard wrote: On Sat, 3 Sep 2016, Adrian Klaver wrote: Or if you are fine running the 9.5 instance at port 5432, what happens if you do?: psql -d postgres -U some_user -p 5432 $ psql -d postgres -U

Re: [GENERAL] Restricted access on DataBases

2016-09-05 Thread Charles Clavadetscher
T PRIVILEGES command. " As I think we can't mix the rights (Main_Admin = US_A + US_B + US_C...). Actually you could: GRANT us_a, us_b, us_c TO main_admin; Now, if you have time for it, I would suggest that you take it to read about the roles and privileges system in Postg

Re: [GENERAL] Restricted access on DataBases

2016-09-05 Thread Charles Clavadetscher
Hello On 09/05/2016 05:56 PM, Charles Clavadetscher wrote: Hello On 09/05/2016 04:19 PM, Adrian Klaver wrote: On 09/05/2016 05:45 AM, Durumdara wrote: Dear PG-masters! We want to put more databases to one server, to "public" schema: DB_A, DB_B, DB_C. The PUBLIC schema is contai

Re: [GENERAL] Check if there 6 last records of same type without gaps

2016-09-06 Thread Charles Clavadetscher
e GROUP BY clause or be used in an aggregate function| > Where: PL/pgSQL function words_skip_game(integer,integer) line 27 at SQL > statement You must group by played, as the message suggests. You are implicitly selecting the column through order by, although you don't have it

Re: [GENERAL] Restricted access on DataBases

2016-09-07 Thread Charles Clavadetscher
Hello On 09/07/2016 03:24 PM, Durumdara wrote: Dear Everybody! I read the documentation based on your example. First reactions. 2016-09-05 18:25 GMT+02:00 Charles Clavadetscher mailto:clavadetsc...@swisspug.org>>: GRANT us_a, us_b, us_c TO main_admin; Ah, it's good.

Re: [GENERAL] Restricted access on DataBases

2016-09-07 Thread Charles Clavadetscher
Hello I did oversee the additional questions... On 09/07/2016 06:45 PM, Charles Clavadetscher wrote: Hello On 09/07/2016 03:24 PM, Durumdara wrote: Dear Everybody! I read the documentation based on your example. First reactions. 2016-09-05 18:25 GMT+02:00 Charles Clavadetscher

Re: [GENERAL] Restricted access on DataBases

2016-09-14 Thread Charles Clavadetscher
Hello From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Durumdara Sent: Mittwoch, 14. September 2016 17:13 Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] Restricted access on DataBases Dear Adrian and Charles! I tried to create

[GENERAL] Question on replace function

2016-09-25 Thread Charles Clavadetscher
Firstname Lastname\r\\rEMAIL;TYPE=INTERNET;TYPE=OTHER:email\r\\rEND:VCARD (1 row) Does anybody have an idea what I am doing wrong? Thank you for your help. Charles -- Swiss PostgreSQL Users Group c/o Charles Clavadetscher Treasurer Motorenstrasse 18 CH – 8005 Zürich http://www.swisspug.org +-

Re: [GENERAL] Question on replace function [solved]

2016-09-25 Thread Charles Clavadetscher
Hi Rob On 09/25/2016 01:39 PM, rob stone wrote: > > On Sun, 2016-09-25 at 10:29 +0200, Charles Clavadetscher wrote: >> Hello >> >> I am using PostgreSQL 9.4.7 on x86_64-unknown-linux-gnu, compiled by >> gcc >> (Debian 4.7.2-5) 4.7.2, 64-bit >> &g

Re: [GENERAL] Question on replace function [solved]

2016-09-25 Thread Charles Clavadetscher
Hello Tom and Adrian > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Adrian Klaver > Sent: Sonntag, 25. September 2016 18:38 > To: Tom Lane ; Charles Clavadetscher > > Cc: pgsql-general@pos

Re: [GENERAL] Restricted access on DataBases

2016-10-04 Thread Charles Clavadetscher
alter default privileges statement. In the second it works if you create a table as user u_tr_main. > --- > > > db_testrole-# \ddp > Default access privileges > Owner | Schema | Type | Access privileges > ---++

Re: [GENERAL] pg_sample

2016-10-18 Thread Charles Clavadetscher
some.rows.sh I may be overseeing something, but what about dependencies between tables, sequencies, indexes, etc.? I guess that if one takes the first 100 rows of a table referenced by another table, there is no guarantee that in the first 100 rows of the referencing table there will not be s

Re: [GENERAL] Request to share information regarding errors

2016-11-15 Thread Charles Clavadetscher
key contraint on table2 using id and phone_id. CREATE UNIQUE INDEX table2_pkey ON table2 (id, phone_id); ALTER TABLE table2 ADD PRIMARY KEY USING INDEX table2_pkey; After that you should be able to add the foreign key to table1. Hope this helps. Charles > Could you please share the details o

Re: [GENERAL] Request to share information regarding errors

2016-11-15 Thread Charles Clavadetscher
Hello Yogesh > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Yogesh Sharma > Sent: Mittwoch, 16. November 2016 07:59 > To: Charles Clavadetscher ; > pgsql-general@postgresql.org > Subject:

Re: [GENERAL] Request to share information regarding deadlock in postgresql-9.3.6

2016-11-17 Thread Charles Clavadetscher
ull roll_number | character varying(20) | not null Indexes: "table1_pkey" PRIMARY KEY, btree (id, roll_number) Foreign-key constraints: "fk_key" FOREIGN KEY (id, roll_number) REFERENCES table2(id, roll_number) ON UPDATE RESTRICT ON DELETE RESTRICT Regards Charles >

Re: [GENERAL] Request to share information regarding deadlock in postgresql-9.3.6

2016-11-17 Thread Charles Clavadetscher
Rethinking that > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Charles > Clavadetscher > Sent: Donnerstag, 17. November 2016 09:12 > To: 'Yogesh Sharma' ; 'John R Pierce'

[GENERAL] max_connections limit violation not showing in pg_stat_activity

2016-11-22 Thread Charles Clavadetscher
using the database, but is the only one where we expect such peaks). So I'd be very grateful for advice on this subject. Thank you. Regards Charles -- Swiss PostgreSQL Users Group c/o Charles Clavadetscher Treasurer Motorenstrasse 18 CH – 8005 Zürich http://w

Re: [GENERAL] max_connections limit violation not showing in pg_stat_activity

2016-11-23 Thread Charles Clavadetscher
Hello Kevin Thank you very much for your input. I appreciate it very much. > -Original Message- > From: Kevin Grittner [mailto:kgri...@gmail.com] > Sent: Dienstag, 22. November 2016 22:37 > To: Charles Clavadetscher > Cc: pgsql-general@postgresql.org > Sub

Re: [GENERAL] Extensions and privileges in public schema

2016-12-05 Thread Charles Clavadetscher
t > dropping various PostGIS (and other) tables and functions. Additionally, > while I doubt the students would do > something like drop a public function or supporting table (like > spatial_ref_sys), it nonetheless seems like a poor > idea for these database objects to be vuln

Re: [GENERAL] When to use COMMENT vs --

2016-12-07 Thread Charles Clavadetscher
fact we have integrated this feature to extract comments to generate the DB documentation in our internal MediaWiki based wiki. If you are interested in more details on that, including additional reasons why it is a good idea to use "comments on" instead of comments in the source co

Re: [GENERAL] Who dropped a role?

2016-12-08 Thread Charles Clavadetscher
Hello From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Durumdara Sent: Donnerstag, 8. Dezember 2016 10:13 To: pgsql-general@postgresql.org Subject: Re: [GENERAL] Who dropped a role? Hello! Sorry, meanwhile I found it as Group Role. I ne

Re: [GENERAL] max_connections limit violation not showing in pg_stat_activity

2016-12-08 Thread Charles Clavadetscher
Hello Kevin Getting back at this. > -Original Message- > From: Kevin Grittner [mailto:kgri...@gmail.com] > Sent: Mittwoch, 23. November 2016 17:04 > To: Charles Clavadetscher > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] max_connections limit violat

Re: [GENERAL] Importing SQLite database

2016-12-08 Thread Charles Clavadetscher
ame | last_value | start_value | increment_by | max_value | min_value | cache_value | log_cnt | is_cycled | is_called ---++-+--+-+---+-+-+---+--- test_id_seq | 1 |

Re: [GENERAL] Recursive row level security policy

2016-12-15 Thread Charles Clavadetscher
) > VALUES (1, 'foo', 1), (2, 'bar', 1), (3, 'baz', 3); > > GRANT SELECT ON accounts TO PUBLIC; > > ALTER TABLE accounts ENABLE ROW LEVEL SECURITY; > > CREATE POLICY account_ownership ON accounts FOR SELECT > USING (owner_id = (SELECT id FROM accoun

Re: [GENERAL] Recursive row level security policy

2016-12-15 Thread Charles Clavadetscher
Hello Simon > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Simon Charette > Sent: Freitag, 16. Dezember 2016 07:02 > To: Charles Clavadetscher > Cc: pgsql-general@postgresql.org >

Re: [GENERAL] Recursive row level security policy

2016-12-15 Thread Charles Clavadetscher
Hello again > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Charles > Clavadetscher > Sent: Freitag, 16. Dezember 2016 07:41 > To: 'Simon Charette' > Cc: pgsql-general@postgre

Re: [GENERAL] Delete from table conditionally

2016-12-16 Thread Charles Clavadetscher
1 | 25 | 270 | Arup > (10 rows) > > > Say, I know the id 6 where content is "Arup". Now from this row, I want to > delete all next rows where the content is > "Arup". How should I achieve this? Assuming that "next" means id > 6:

Re: [GENERAL] Book or other resource on Postgres-local code?

2016-12-29 Thread Charles Clavadetscher
ion/?utm_source=PoD&utm_medium=referral&utm_campaign=1783980583> &utm_medium=referral&utm_campaign=1783980583 Regards Charles Seems like a thing that should exist. I can find a variety of blog posts, mostly about Oracle and MS SQL Server, but nothing that appears part

Re: [GENERAL] performance tuning postgresql 9.5.5.10 [enterprisedb]

2016-12-29 Thread Charles Clavadetscher
gs: SELECT * FROM pg_size_pretty((100.0*(2^20)*10.0)::BIGINT); -[ RECORD 1 ]--+ pg_size_pretty | 9766 GB This could explain the errors you get from the server. You may be trying to use much more memory than you have. Regards Charles > [postgresql.conf] > max_connect

FW: [GENERAL] performance tuning postgresql 9.5.5.10 [enterprisedb]

2016-12-29 Thread Charles Clavadetscher
Forwarding to list. -Original Message- From: ajmcello [mailto:ajmcell...@gmail.com] Sent: Freitag, 30. Dezember 2016 07:05 To: Charles Clavadetscher Subject: Re: [GENERAL] performance tuning postgresql 9.5.5.10 [enterprisedb] There are no connections except one cli when running the

Re: [GENERAL] Special index for "like"-based query

2016-12-30 Thread Charles Clavadetscher
| > > Indexes: > "webtraffic_archive_day_2016_04_15_action_wbidx" btree (action) > "webtraffic_archive_day_2016_04_15_domain_wbidx" btree (domain) > "webtraffic_archive_day_2016_04_15_profile_wbidx" btree (profile) CLUSTER >

Re: [GENERAL]

2015-11-15 Thread Charles Clavadetscher
tore again (steps 5-7). You may also try to omit step 6 but then all you DB objects will be owned by postgres. If this is what you need it is fine. Hope this helps. Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Alex

Re: [GENERAL]

2015-11-15 Thread Charles Clavadetscher
Instead of creating a superuser you may simply grant the privilege on the database: CREATE ROLE alex LOGIN PASSWORD '...'; GRANT CREATE ON DATABASE icare TO alex; Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Charles Clavadetscher
Hello Why don’t you simply change the port in postgresql.conf and restart the server? Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Killian Driscoll Sent: Mittwoch, 23. Dezember 2015 09:58 To: pgsql-general Subject

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Charles Clavadetscher
with plain pg_dump. > >pg_dump -h localhost -p 5432 -Fc > dump.sql > >pg_restore -h localhost -p 5532 dump.sql > >I tried this, but nothing appears to happen when entering the commands. >Attached is a screenshot of the shell window - what am I doing wrong? This should

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Charles Clavadetscher
From: Killian Driscoll [mailto:killiandrisc...@gmail.com] Sent: Mittwoch, 23. Dezember 2015 11:02 To: Charles Clavadetscher Cc: Andreas Kretschmer ; pgsql-general Subject: Re: [GENERAL] Transfer db from one port to another On 23 December 2015 at 10:58, Charles Clavadetscher

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Charles Clavadetscher
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Killian Driscoll Sent: Mittwoch, 23. Dezember 2015 11:19 To: John R Pierce Cc: pgsql-general Subject: Re: [GENERAL] Transfer db from one port to another On 23 December 2015 at 11:07, John R Pier

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Charles Clavadetscher
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Killian Driscoll Sent: Mittwoch, 23. Dezember 2015 11:26 To: John R Pierce Cc: pgsql-general Subject: Re: [GENERAL] Transfer db from one port to another On 23 December 2015 at 11:19, Killian

Re: [GENERAL] Transfer db from one port to another

2015-12-23 Thread Charles Clavadetscher
We had that already upthread. Did you set the path to the bin dir of PostgreSQL as of previous posts? Regards Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Killian Driscoll Sent: Mittwoch, 23. Dezember 2015 15:14 To: Adrian

Re: [GENERAL] Strange syntax with select

2015-12-25 Thread Charles Clavadetscher
> \set testvar 'sum(id) from test' db => select :testvar; sum - 55 (1 row) Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Edson F. Lidorio Sent: Freitag, 25. Dezember 2015 14:23 To: pgsql-general@

Re: [GENERAL] How do I implement a .XSD in Postgres?

2016-01-01 Thread Charles Clavadetscher
g_text,_xml_content_into_a_field Bye Charles From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of David G. Johnston Sent: Freitag, 1. Januar 2016 19:02 To: ERR ORR Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] How do I implement a .XSD in Postgres?

Re: [GENERAL] Function error

2016-01-07 Thread Charles Clavadetscher
alues returned that you need. Bye Charles > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Sachin Srivastava > Sent: Freitag, 8. Januar 2016 08:24 > To: pgsql-general@postgresql.org > Subject: [

Re: [GENERAL] Slow Query - PostgreSQL 9.2

2016-01-10 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Saulo Merlo > Sent: Montag, 11. Januar 2016 08:12 > To: Vitaly Burovoy > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Slow Query - PostgreSQL 9.2

Re: [GENERAL] Giving error for function

2016-01-12 Thread Charles Clavadetscher
Hello > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Sachin Srivastava > Sent: Dienstag, 12. Januar 2016 08:40 > To: pgsql-general@postgresql.org >> PG-General Mailing List > > Subject: [GENERAL] Giving error fo

Re: [GENERAL] ERROR: check constraint - PostgreSQL 9.2

2016-01-24 Thread Charles Clavadetscher
m which it must apply. Bye Charles > -Original Message- > From: pgsql-general-ow...@postgresql.org > [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Christophe Pettus > Sent: Montag, 25. Januar 2016 05:18 > To: Postgres General > Subject: Re: [GENERAL] ERROR: c

  1   2   3   >