Re: relkind='p' has no pg_stat_user_tables

2018-05-03 Thread Adrian Klaver
ation_filenode() function. " Is there any good workaround other than making stampfiles or making my own "last analyzed" table? Thanks, Justin -- Adrian Klaver adrian.kla...@aklaver.com

Re: relkind='p' has no pg_stat_user_tables

2018-05-03 Thread Adrian Klaver
On 05/03/2018 08:45 AM, Justin Pryzby wrote: On Thu, May 03, 2018 at 07:44:24AM -0700, Adrian Klaver wrote: On 05/03/2018 07:14 AM, Justin Pryzby wrote: I (finally) realized that my script for ANALYZEing parents of table hierarchies every month or so was looping around the same parent tables

Re: relkind='p' has no pg_stat_user_tables

2018-05-03 Thread Adrian Klaver
On 05/03/2018 09:20 AM, Alvaro Herrera wrote: Adrian Klaver wrote: and from here: https://www.postgresql.org/docs/10/static/sql-createtable.html "A partitioned table is divided into sub-tables (called partitions), which are created using separate CREATE TABLE commands. The partitioned

Re: CSVQL? CSV SQL? tab-separated table I/O? RENAME COLUMN

2018-05-03 Thread Adrian Klaver
On 05/03/2018 09:47 AM, George Neuner wrote: On Wed, 2 May 2018 16:01:01 -0700, Adrian Klaver wrote: On 05/02/2018 02:29 PM, Jim Michaels wrote: - the microsoft patented CSV would be required for implementation. it handles special data with commas and double-quotes in them Huh?: https

Re: relkind='p' has no pg_stat_user_tables

2018-05-03 Thread Adrian Klaver
On 05/03/2018 10:38 AM, Justin Pryzby wrote: On Thu, May 03, 2018 at 09:31:12AM -0700, Adrian Klaver wrote: On 05/03/2018 09:20 AM, Alvaro Herrera wrote: https://www.postgresql.org/docs/10/static/sql-createtable.html "A partitioned table is divided into sub-tables (called partitions),

Re: How to find the hits on the databases and tables in Postgres

2018-05-04 Thread Adrian Klaver
, -- Adrian Klaver adrian.kla...@aklaver.com

Re: statement_timeout issue

2018-05-04 Thread Adrian Klaver
to statement timeout 2018-05-04 04:05:20 PDT [62028]: [83-1] CONTEXT:  SQL statement "SELECT 1 FROM ONLY "public"."clients" x WHERE "c_id" OPERATOR(pg_catalog.=) $1 FOR KEY SHARE OF x" 2018-05-04 04:05:20 PDT [62028]: [84-1] STATEMENT:  INSERT /* Is t

Re: How to find the hits on the databases and tables in Postgres

2018-05-04 Thread Adrian Klaver
On 05/04/2018 09:45 AM, nikhil raj wrote: Hi Adrian Klaver, Thanks for the fast response . But here is the issue is here we have 200+ databases and 5 servers so cannot manually runs this command all ways is there any 3rd party tool for that which would give me the hits on DB and tables in it

Re: comparison between 2 execution plans

2018-05-05 Thread Adrian Klaver
tkey     and l_orderkey = o_orderkey     and o_orderdate < date '1995-03-21'     and l_shipdate > date '1995-03-21' group by     l_orderkey,     o_orderdate,     o_shippriority order by     revenue desc,     o_orderdate ------ best regards Neto -- Adrian Klaver adrian.kla...@aklaver.com

Re: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification

2018-05-05 Thread Adrian Klaver
mn in the stats table has neither a unique or exclusion constraint on it. And my second problem is: the above query only calculates "half the picture", when a player is stored in the player1 column. How to add "the second half", when the player had a single Q left, while she was player2? Should I use SELECT UNION or maybe CASE WHEN ... END? Thank you Alex -- Adrian Klaver adrian.kla...@aklaver.com

Re: pg_dump with compressible and non-compressible tables

2018-05-05 Thread Adrian Klaver
d data and therefore will be included when --data-only is used, but not when --schema-only is. " These are different critters then bytea. Thanks -- Adrian Klaver adrian.kla...@aklaver.com

Re: ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification

2018-05-05 Thread Adrian Klaver
NFLICT work you need to trip the following: https://www.postgresql.org/docs/10/static/sql-insert.html#SQL-ON-CONFLICT "The optional ON CONFLICT clause specifies an alternative action to raising a unique violation or exclusion constraint violation error." Regards Alex --

Re: comparison between 2 execution plans

2018-05-05 Thread Adrian Klaver
On 05/05/2018 10:51 AM, Neto pr wrote: Dear, 2018-05-05 9:57 GMT-07:00 Adrian Klaver <mailto:adrian.kla...@aklaver.com>>: On 05/05/2018 06:26 AM, Neto pr wrote: It might help if you explained what 'version with source code changed by me' means? Postg

Re: pg_dump with compressible and non-compressible tables

2018-05-05 Thread Adrian Klaver
On 05/05/2018 12:41 PM, Ron wrote: On 05/05/2018 12:13 PM, Adrian Klaver wrote: On 05/05/2018 07:14 AM, Ron wrote: Hi, v9.6 We've got big databases where some of the tables are highly compressible, but some have many bytea fields containing PDF files. Can you see a demonstrable diffe

Re: Known Bugs on Postgres 9.5

2018-05-05 Thread Adrian Klaver
uled dates . Thank you, Anudeep -- Adrian Klaver adrian.kla...@aklaver.com

Re: Known Bugs on Postgres 9.5

2018-05-05 Thread Adrian Klaver
://www.postgresql.org/message-id/20180429222104.GA25267%40fetter.org Scroll down to the the Applied Patches and/or Pending Patches section(s). Thank you, Anudeep -- Adrian Klaver adrian.kla...@aklaver.com

Re: User defined functions in Postgresql, troubles with the c code

2018-05-06 Thread Adrian Klaver
include the linbintl.h file in the source code or what should I Do? I see you are on Windows. How did you install Postgres? -- Adrian Klaver adrian.kla...@aklaver.com

Re: psycopg2.DataError: invalid input syntax for integer: ""

2018-05-07 Thread Adrian Klaver
o add single quotes around the %s symbols.  That doesn't really explain the integer input error though I'm not familiar with the exact features of the execute method in Python. They do not need to be quoted: http://initd.org/psycopg/docs/usage.html#passing-parameters-to-sql-queries David J. -- Adrian Klaver adrian.kla...@aklaver.com

Re: psycopg2.DataError: invalid input syntax for integer: ""

2018-05-07 Thread Adrian Klaver
#x27;s a limitation for the number of timestamp with timezone fields in a table? Not one that is likely to matter in practice.  There's a page discussing limitations on the website/docs somewhere if you wish to find out more. David J. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Is it possible to get username information while writingtrigger?

2018-05-07 Thread Adrian Klaver
ill be executed as the owner of the table, so it would be better to use "session_user" to avoid surprises. You cannot get the column name, because PostgreSQL updates a whole row, not an individual column. The best you can do is to check which column values are different in OLD and NEW. Y

Re: Run external command as part of an sql statement ?

2018-05-07 Thread Adrian Klaver
n as a superuser. Thanks -- Adrian Klaver adrian.kla...@aklaver.com

Re: KeyError: self._index[x]

2018-05-07 Thread Adrian Klaver
y a single function call should be the name of the function.  So "translate", not "snumber" - the latter being consumed by the function. You can as use "as " to give it a different fixed name and refer to that. David J. -- Adrian Klaver adrian.kla...@aklaver.com

Re: KeyError: self._index[x]

2018-05-07 Thread Adrian Klaver
select translate('test', '', ''); translate --- test # This works fine for row in cur_t: print row[0] Above you are using as a sequence, so the indexing works. Sorry again. I would really appreciate any suggestions. Thanks, J -- Adrian Klaver adrian.kla...@aklaver.com

Re: cursor empty

2018-05-08 Thread Adrian Klaver
but discard the result, for example when calling a function that has side-effects but no useful result value. To do this in PL/pgSQL, use the PERFORM statement: PERFORM query; This executes query and discards the result. ..." ^^^ Thanks Phil -- Adrian Klaver adrian.kla...@aklaver.com

Re: Error creating plpython3u extension

2018-05-08 Thread Adrian Klaver
nks Bruce -- Adrian Klaver adrian.kla...@aklaver.com

Re: Concatenate 2 Column Values For One Column

2018-05-08 Thread Adrian Klaver
stname']) ) The second code works but it includes the parenthesis in the DB. That is because: (row['firstname'], row['lastname']) is making a Python tuple for entry into the last %s. Not tested but try: (row['firstname'] + ', ' + row['lastname']) How can I remove the ( ) in the DB? I can't call the row['firstname'] and row['lastname'] as values without using ( ). Any suggestion is highly appreciated. Thanks, J -- Adrian Klaver adrian.kla...@aklaver.com

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Adrian Klaver
es to make sure that the PostgreSQL service (PostgreSQL 9.5 Server) was running. I restarted the service too. What an I missing?  Appreciate any help on this. Thanks, Chandru -- Adrian Klaver adrian.kla...@aklaver.com

Re: issues when installing postgres

2018-05-09 Thread Adrian Klaver
appreciate any help. Thanks in advance. All the best -- Antônio Olinto Ávila da Silva -- Adrian Klaver adrian.kla...@aklaver.com

Re: Error creating plpython3u extension

2018-05-09 Thread Adrian Klaver
core. Not sure how to solve this. I don't run Windows enough anymore to offer any suggestions. Maybe someone from EDB will chime in. -Original Message- From: Bruce Harold Sent: Wednesday, May 9, 2018 9:46 AM To: 'Adrian Klaver' ; pgsql-general@lists.postgresql.or

Re: Why is my Postgre server went in recovery mode all in sudden

2018-05-09 Thread Adrian Klaver
ver Current using 10.3 |  Current Config max_connections = 5000|| shared_buffers = 7680MB effective_cache_size = 23040MB ||| |maintenance_work_mem = 1920MB min_wal_size = 1GB max_wal_size = 2GB checkpoint_completion_target = 0.7 wal_buffers = 16MB default_statistics_target = 100 random_page_cost = 1.1 effective_io_concurrency = 200 max_worker_processes = 16 max_parallel_workers_per_gather = 8 max_parallel_workers = 16 work_mem = 196kB| Thanks -- Adrian Klaver adrian.kla...@aklaver.com

Re: issues when installing postgres

2018-05-09 Thread Adrian Klaver
. Thanks Antonio 2018-05-09 10:36 GMT-03:00 Adrian Klaver <mailto:adrian.kla...@aklaver.com>>: On 05/08/2018 05:54 PM, Antonio Silva wrote: Hello! Comments inline. I bought a new computer and I installed Ubuntu 18.04 and after PostgreSQL.

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Adrian Klaver
/pgadmin4/3.x/connecting.html Contents: The Server Dialog Inline image On Wednesday, May 9, 2018, 8:28:44 AM CDT, Adrian Klaver wrote: On 05/08/2018 06:12 PM, chandru.ar...@yahoo.com <mailto:chandru.ar...@yahoo.com> wrote: > I installed PostgreSQL using PostgreSQL-9.5.1

Re: New install of 9.5.12 missing default PostgreSQL DB

2018-05-09 Thread Adrian Klaver
On 05/09/2018 07:12 PM, Chandru Aroor wrote: I don't even have a server to connect to and that is my problem. I thought you said earlier that the Postgres service was running. Is it running? On Wednesday, May 9, 2018, 6:48:40 PM CDT, Adrian Klaver wrote: On 05/09/2018 06:

Re: ON CONFLICT DO UPDATE

2018-05-09 Thread Adrian Klaver
ntBalance points to. 2) The ON CONFLICT DO UPDATE clause you created on the table. Thanks, J -- Adrian Klaver adrian.kla...@aklaver.com

Re: ON CONFLICT DO UPDATE

2018-05-10 Thread Adrian Klaver
e are the duplicate fields. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Adrian Klaver
ose? …..maybe I’ve just got a subjective prejudice for using domains to refine and tighten built in data types…. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Why is my Postgre server went in recovery mode all in sudden

2018-05-10 Thread Adrian Klaver
, what is it doing? ans : query running from an agent if any processing is going on the front end some of the query will run So there is process that opens a connection, leaves it open and then periodically runs queries? Has the database shutdown happened again? -- Adrian Klaver adrian.kla

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Adrian Klaver
On 05/10/2018 09:09 AM, Ben Hood wrote: On 10 May 2018, at 14:41, Adrian Klaver wrote: OK, so by using TIMESTAMP WITH TIME ZONE, you force all apps to submit timezone qualified timestamps in what language they are written in. Not really: https://www.postgresql.org/docs/10/static/datatype

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Adrian Klaver
rom looking at the database values you still do not know what the original timezone the app lives in is. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Adrian Klaver
--- 0 (1 row) - What your check probably does is to enforce that the client's time zone is set to UTC. hp -- Adrian Klaver adrian.kla...@aklaver.com

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-10 Thread Adrian Klaver
ck values (6, '05/10/18 15:23+00'); ERROR: value for domain utc_timestamp violates check constraint "utc_timestamp_check" -- Adrian Klaver adrian.kla...@aklaver.com

Re: Why is my Postgre server went in recovery mode all in sudden

2018-05-11 Thread Adrian Klaver
On 05/11/2018 03:30 AM, nikhil raj wrote: Hi Adrian Klaver, No its like it opens  connection and once the query gets execute it goes to idle connection and again idle connection time out i kept it for 2 mins . It never happen again. need few answers why will share buffer crashes ? From

Re: Best conception of a table

2018-05-12 Thread Adrian Klaver
ow was added or updated in the table product_price_period. I want to know if it's a good practice to use temporary tables (when should temporary tables will be used) or I use CTE and keep the first solution (despite the long query that I should to write in order to select the data)? Ever

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-12 Thread Adrian Klaver
0'); INSERT 0 1 cdrs=# insert into t values (current_timestamp); INSERT 0 1 cdrs=# select * from t; ts --- 2015-05-11 10:20:30+00 2015-05-11 08:20:30+00 2015-05-11 10:20:30+00 2018-05-12 10:59:54.289827+00 (4 rows) cdrs=# rollback; ROLLBACK Francisco Olarte. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-12 Thread Adrian Klaver
On 05/12/2018 10:22 AM, Francisco Olarte wrote: Adrian: On Sat, May 12, 2018 at 6:42 PM, Adrian Klaver wrote: On 05/12/2018 04:04 AM, Francisco Olarte wrote: ... Can you post an example ( correct, error inputs, preferrably done with psql ) ? At this point I do not know if it is working or

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-13 Thread Adrian Klaver
On 05/13/2018 01:55 AM, Francisco Olarte wrote: On Sat, May 12, 2018 at 8:19 PM, Adrian Klaver wrote: I would agree that timestamp and timestamptz are both stored as numbers. Well, after reading source that is a fact. I was trying to say they are like real numbers, a point in a line. I

Re: Domain based on TIMEZONE WITH TIME ZONE

2018-05-13 Thread Adrian Klaver
On 05/13/2018 03:45 PM, Peter J. Holzer wrote: On 2018-05-13 12:46:42 -0700, Adrian Klaver wrote: Not trying to trick anyone and no magic. The difference in the represented values between ts_tz and ts_naive is the heart of my argument. Timestamptz values are stored in manner that allows you to

Re: 10.4 upgrade, function markings, and template0

2018-05-14 Thread Adrian Klaver
nice about the news release is you can cut and past the entire list of commands and do the updates en masse. regards, tom lane -- Adrian Klaver adrian.kla...@aklaver.com

Re: 10.4 upgrade, function markings, and template0

2018-05-14 Thread Adrian Klaver
On 05/14/2018 02:22 PM, Tom Lane wrote: Adrian Klaver writes: On 05/14/2018 02:02 PM, Tom Lane wrote: I didn't bother with spelling it all out in full detail this time, which maybe was a mistake, but I felt that probably most users wouldn't need to bother with these changes at all (

Re: Query ID Values

2018-05-14 Thread Adrian Klaver
t IDs ( Senior High, Vocational, Undergraduate ) and each ID have multiple programs/courses. Each program/course is connected to the deparment table via department_id. May I ask an advice on how to approach this? Thanks, J -- Adrian Klaver adrian.kla...@aklaver.com

Re: Query ID Values

2018-05-15 Thread Adrian Klaver
On 05/14/2018 10:04 PM, Ian Zimmerman wrote: On 2018-05-14 21:12, Adrian Klaver wrote: Because you are doing fetchall(). That is going to fetch a list of row tuples. Either iterate over that list or iterate over the cursor: for row in cur_p: print(row) For more info see: http

Re: Function to set up variable inside it

2018-05-15 Thread Adrian Klaver
On 05/15/2018 05:28 AM, Łukasz Jarych wrote: Hi Guys, I am using postgres 10.3 (or 4?). IT is possible to set up variable inside function? Like this?: https://www.postgresql.org/docs/10/static/plpgsql-declarations.html Best, Jacek -- Adrian Klaver adrian.kla...@aklaver.com

Re: sql function with empty row

2018-05-16 Thread Adrian Klaver
ame. I expected equal behavior on my function, so my question is, how can I fix this? Thanks Phil -- Adrian Klaver adrian.kla...@aklaver.com

Re: sql function with empty row

2018-05-16 Thread Adrian Klaver
ds are set to NULL. Ignore my previous post I got turned around on what was being returned. If I run the join query directly it returns an empty record set on a non-existing trivial name. I expected equal behavior on my function, so my question is, how can I fix this? Thanks Phil -- Adr

Re: sql function with empty row

2018-05-16 Thread Adrian Klaver
. I expected equal behavior on my function, so my question is, how can I fix this? Thanks Phil -- Adrian Klaver adrian.kla...@aklaver.com

Re: sql function with empty row

2018-05-16 Thread Adrian Klaver
On 05/16/2018 11:49 AM, Philipp Kraus wrote: Am 16.05.2018 um 20:40 schrieb Adrian Klaver : I have tested it on my data and it works also, but that is a little bit confusing, because imho setof is >= 0 rows and without setof it is [0,1]. On this I know there exist only one or no rec

Re: When use triggers?

2018-05-16 Thread Adrian Klaver
re. I use Sqitch(http://sqitch.org/) which allows me to deploy and revert changes. I use a dev database to test and troubleshoot triggers and functions. -- Adrian Klaver adrian.kla...@aklaver.com

Re: initdb failing (10.4 centos7)

2018-05-19 Thread Adrian Klaver
-- Mike Nolan -- Adrian Klaver adrian.kla...@aklaver.com

Re: initdb failing (10.4 centos7)

2018-05-19 Thread Adrian Klaver
DIR is on you: https://www.postgresql.org/docs/10/static/install-short.html -- Mike Nolan -- Adrian Klaver adrian.kla...@aklaver.com

Re: initdb failing (10.4 centos7)

2018-05-19 Thread Adrian Klaver
On 05/19/2018 03:44 PM, Michael Nolan wrote: On Sat, May 19, 2018 at 5:23 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/19/2018 03:16 PM, Michael Nolan wrote: On Sat, May 19, 2018 at 2:16 PM, Don Seiler mailto:d...@seiler.us> <mailto:d.

Re: initdb failing (10.4 centos7)

2018-05-19 Thread Adrian Klaver
On 05/19/2018 03:44 PM, Michael Nolan wrote: On Sat, May 19, 2018 at 5:23 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: Then setting up the $DATADIR is on you: https://www.postgresql.org/docs/10/static/install-short.html <https://www.postgresql.or

Re: initdb failing (10.4 centos7)

2018-05-19 Thread Adrian Klaver
On 05/19/2018 04:06 PM, David G. Johnston wrote: On Saturday, May 19, 2018, Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 05/19/2018 03:44 PM, Michael Nolan wrote: On Sat, May 19, 2018 at 5:23 PM, Adrian Klaver mailto:adrian.kla...@ak

Re: Fwd: postgresql is down in whm status page

2018-05-20 Thread Adrian Klaver
ing relevant to this problem? Thank you -- Adrian Klaver adrian.kla...@aklaver.com

Re: postgresql is down in whm status page

2018-05-20 Thread Adrian Klaver
Install+or+Update+PostgreSQL+on+Your+cPanel+Server *Yes, I used this doc.* Thank you 5) Are there logs for WHM and do they show anything relevant to this problem? On May 20, 2018, at 5:19 PM, Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: On 05/19/2018 01:13 PM, Arta S wrot

Re: Aggregate functions with FROM clause and ROW_COUNT diagnostics

2018-05-21 Thread Adrian Klaver
T) without performing it twice? Thanks, Off the top of my head: SELECT count(*) as ct, foo, bar, baz ... retcode = result ->'ct' ./danfe -- Adrian Klaver adrian.kla...@aklaver.com

Re: posgresql.log

2018-05-21 Thread Adrian Klaver
other servers… Could you be so kind and explain me what is it? I am afraid my postgres has been hacekd. Best Regards */Bartosz Dmytrak/* -- Adrian Klaver adrian.kla...@aklaver.com

Re: source of connection fails at pg startup?

2018-05-22 Thread Adrian Klaver
ions made by postgresql itself or is this likely from some Ubuntu- specific configuration? Thanks. -- Adrian Klaver adrian.kla...@aklaver.com

Re: [GENERAL] Postgre compatible version with RHEL 7.5

2018-05-23 Thread Adrian Klaver
na 122 003, India Phone 0124-6243000 deepti.s.sha...@ericsson.com <mailto:deepti.s.sha...@ericsson.com> www.ericsson.com <http://www.ericsson.com> *From:*David G. Johnston [mailto:david.g.johns...@gmail.com] *Sent:* Monday, May 21, 2018 6:54 PM *To:* Deepti Sharma S *Cc:* Adria

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
that exist. Well that made my day:) David J. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
ected from anywhere, for example: SELECT name, age FROM some_table. The second thing I see is why not use ON CONFLICT? this doesn't give me error but it doesn't insert data either. On Thu, May 24, 2018 at 3:35 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: O

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
my_table WHERE name= name) this doesn't give me error but it doesn't insert data either. I'm doubting your assertion that it doesn't error.   How do you run that query such that age and name are recognized given the main query doesn't have a from clause? David J. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
e on any column appearing within index_expression is required. " I take this to mean something like: ON CONFLICT UNIQUE INDEX name_idx ON my_table(name) On Thu, May 24, 2018 at 8:04 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/23/2018 04:58 PM, tango ward wrot

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
On 05/23/2018 06:03 PM, tango ward wrote: On Thu, May 24, 2018 at 8:19 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/23/2018 05:11 PM, tango ward wrote: Sorry, i forgot the values. curr.pgsql.execute(''' INSERT IN

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
On 05/23/2018 08:04 PM, tango ward wrote: On Thu, May 24, 2018 at 10:55 AM, David G. Johnston mailto:david.g.johns...@gmail.com>> wrote: On Wednesday, May 23, 2018, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: INSERT INTO my_table(%s, %s) WHER

Re: Insert data if it is not existing

2018-05-23 Thread Adrian Klaver
On 05/23/2018 07:59 PM, tango ward wrote: On Thu, May 24, 2018 at 10:51 AM, Adrian Klaver Try the example I showed previously. If you do not want to use the the named parameters e.g %(name)s then use use %s and a tuple like: ''' INSERT INTO my_table(%s, %s

Re: Insert data if it is not existing

2018-05-24 Thread Adrian Klaver
On 05/23/2018 09:39 PM, David G. Johnston wrote: On Wednesday, May 23, 2018, Adrian Klaver <mailto:adrian.kla...@aklaver.com>> wrote: '''INSERT INTO my_table(name, age) SELECT %s, %s WHERE NOT EXISTS(SELECT name FROM my_table WHERE name=%s)&

Re: Insert data if it is not existing

2018-05-24 Thread Adrian Klaver
ment, I will get an error message: error : psycopg2.ProgrammingError: syntax error at or near "WHERE" LINE 12: WHERE NOT EXISTS Trying to coordinate with Lead Dev about adding Index On The Fly I tried to figure how to make this work and could not, so I led you down

Re: Extension/Language of plPerl in PostgreSQL

2018-05-24 Thread Adrian Klaver
secret or privileged information. Any unauthorized review, use, disclosure or distribution is prohibited and may be a violation of law. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Extension/Language of plPerl in PostgreSQL

2018-05-24 Thread Adrian Klaver
/Language_Pack_v10/EDB_Postgres_Language_Pack_Guide.1.09.html# Will get back to you in case of any queries. Thanks, Karthick -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Thursday, May 24, 2018 7:31 PM To: Karthick Damodar; pgsql-gene...@postgresql.org Subject

Re: Extension/Language of plPerl in PostgreSQL

2018-05-24 Thread Adrian Klaver
Postgres install. Thanks, Karthick -Original Message- From: Adrian Klaver [mailto:adrian.kla...@aklaver.com] Sent: Thursday, May 24, 2018 7:50 PM To: Karthick Damodar Cc: pgsql-general Subject: Re: Extension/Language of plPerl in PostgreSQL On 05/24/2018 07:11 AM, Karthick Damodar wrote

Re: case statement within insert

2018-05-25 Thread Adrian Klaver
w['subjectname'])) I am getting TypeError: not all arguments converted during string formatting. Any advice pls? -- Adrian Klaver adrian.kla...@aklaver.com

Re: case statement within insert

2018-05-25 Thread Adrian Klaver
On 05/25/2018 06:52 AM, Adrian Klaver wrote: On 05/25/2018 02:04 AM, tango ward wrote: I want to insert data from mysql into a table in postgresql. I want to check when the subjectcode contains PE or NSTP so I can assign True or False to another column in destination DB. # Source data

Re: case statement within insert

2018-05-25 Thread Adrian Klaver
On 05/25/2018 07:05 AM, Adrian Klaver wrote: On 05/25/2018 06:52 AM, Adrian Klaver wrote: On 05/25/2018 02:04 AM, tango ward wrote: I want to insert data from mysql into a table in postgresql. I want to check when the subjectcode contains PE or NSTP so I can assign True or False to another

Re: Syndicating PostgreSQL mailing list to Discourse

2018-05-25 Thread Adrian Klaver
one involved in PostgreSQL for an outstanding piece of software! Sincerely, Erlend -- Adrian Klaver adrian.kla...@aklaver.com

Re: Fast logical replication jump start with PG 10

2018-05-25 Thread Adrian Klaver
k for that. Thanks in advance Olivier Gautherot http://www.linkedin.com/in/ogautherot -- Adrian Klaver adrian.kla...@aklaver.com

Re: Fast logical replication jump start with PG 10

2018-05-25 Thread Adrian Klaver
autherot oliv...@gautherot.net <mailto:oliv...@gautherot.net> Cel:+56 98 730 9361 Skype: ogautherot www.gautherot.net <http://www.gautherot.net> http://www.linkedin.com/in/ogautherot On Fri, May 25, 2018 at 7:51 PM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/25/20

Re: UPDATE from CTE syntax error

2018-05-26 Thread Adrian Klaver
column "m" of relation "words_moves" does not exist LINE 14: SET m.letters = el.letters              ^ Regards Alex -- Adrian Klaver adrian.kla...@aklaver.com

Re: Fast logical replication jump start with PG 10

2018-05-26 Thread Adrian Klaver
On 05/26/2018 06:23 AM, Olivier Gautherot wrote: Hi Adrian! On Sat, May 26, 2018 at 12:11 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/25/2018 06:35 PM, Olivier Gautherot wrote: Hi Adrian, thanks for your reply. Here is the clarification. 1)

Re: Fast logical replication jump start with PG 10

2018-05-26 Thread Adrian Klaver
On 05/26/2018 06:23 AM, Olivier Gautherot wrote: Hi Adrian! On Sat, May 26, 2018 at 12:11 AM, Adrian Klaver mailto:adrian.kla...@aklaver.com>> wrote: On 05/25/2018 06:35 PM, Olivier Gautherot wrote: Hi Adrian, thanks for your reply. Here is the clarification. 1)

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Adrian Klaver
;m also trying to understand the ins and outs of CTEs, so I'm interesting in solving this one! Thanks again, Rgs, Pól... Todd -- Adrian Klaver adrian.kla...@aklaver.com

Re: SQL problem (forgot to change header with earlier post!).

2018-05-29 Thread Adrian Klaver
On 05/29/2018 06:52 AM, Adrian Klaver wrote: On 05/29/2018 05:05 AM, Paul Linehan wrote: Hi again, and thanks for your efforts on my behalf! WITH num AS (     SELECT count (*) as cnt1 FROM v1   ), div AS (     SELECT count (*) as cnt2 FROM v2   )   SELECT (num.cnt1::numeric/div.cnt2)  From

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-29 Thread Adrian Klaver
ng only when we pass password in it’s connection string. But which is not a good practice at all. -- Adrian Klaver adrian.kla...@aklaver.com

Re: Pgagent is not reading pgpass file either in Windows or Linux.

2018-05-29 Thread Adrian Klaver
.1 -d linuxpostgresdb -U postgres psql (8.4.20, server 9.6.6) WARNING: psql version 8.4, server version 9.6.          Some psql features might not work. Type "help" for help. linuxpostgresdb=# -- Adrian Klaver adrian.kla...@aklaver.com

Re: reduce number of multiple values to be inserted

2018-05-29 Thread Adrian Klaver
ne: data_input (Assuming sorted by village and then age) for village in data_input: for age in village: curr_pgsql.execute(''' INSERT INTO student (created, modified, name, address, age, level) VALUES(current_timezone, current_timezone, %s, %s, %s, 2)''', (name, village, age)) Thanks, J -- Adrian Klaver adrian.kla...@aklaver.com

Re: execute block like Firebird does

2018-05-30 Thread Adrian Klaver
n 12, what do you think ? Basically you are asking for DO to be what does not exist at the moment, CREATE TEMPORARY FUNCTION. I would prefer having CREATE TEMPORARY FUNCTION. -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html -- Adrian Klaver adrian.kla...@aklaver.com

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
blem is. I would be happy if someone could help me to solve this situation. -- Saygılarımla -- Adrian Klaver adrian.kla...@aklaver.com

Re: Update rules on views

2018-05-30 Thread Adrian Klaver
TEAD; in the cases where they are applied, they add to the default INSTEAD NOTHING action. (This method does not currently work to support RETURNING queries, however.)" I would go with triggers though: https://www.postgresql.org/docs/9.6/static/sql-createtrigger.html " INSTEAD OF

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
_.kullaniciadi, kullanici2_.kullanicitipienum, kullanici2_.parola, kullan ici2_.soyad                Buffers: shared hit=190 * Planning time: 2.331 ms* * Execution time: 5431.817 ms* * * -- Adrian Klaver adrian.kla...@aklaver.com

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
. Database & Exploration Specialist** Universe Exploration Command – UXC*** Employment by invitation only! -- Adrian Klaver adrian.kla...@aklaver.com

Re: Query running for 12 hours

2018-05-30 Thread Adrian Klaver
On 05/30/2018 07:19 AM, Yavuz Selim Sertoğlu wrote: 2018-05-30 17:02 GMT+03:00 Adrian Klaver <mailto:adrian.kla...@aklaver.com>>: On 05/30/2018 06:54 AM, Yavuz Selim Sertoğlu wrote: I am just a regular dba so I dont know what's sent from application exactl

<    1   2   3   4   5   6   7   8   9   10   >