Re: [GENERAL] Using sequences in SQL text files

2008-02-20 Thread Thomas
On 20 févr. 08, at 08:57, HHB wrote: Thank you all for your help. Let me summer what I'm trying to do: I have an empty database that I want to populate it with data. I created SQL text files, categories.sql, books.sql As I'm a Java guy, I use Apache Ant SQL taks to run those SQL text f

Re: [GENERAL] Experiences with pl/Java

2012-11-20 Thread Thomas
have tested further combinations - without success - any other idea? 1st attempt (note: this implementation works on Apache Derby!) === CREATE OR REPLACE FUNCTION rte."SP_getNextID"(OUT "iNextID" integer, IN "vcIDName" character varying) RETURNS integer LANGUAGE JAVA EXTERNAL SE

[GENERAL] a LEFT JOIN problem

2008-10-25 Thread Thomas
orders.id LEFT OUTER JOIN users ON orders.user_id = users.id WHERE (title = E'some-product' AND paid = 1 AND name = 'thomas') -- The problem with my query, is that if there are no paid associated orders, then the WHERE will drop every returned line that has paid = 0, therefore I

[GENERAL] How to tell PostgreSQL about a relationship

2008-10-26 Thread Thomas
Hi, I have jumped from MySQL to PostgreSQL, and I wanted to know how we declare that a table depends on another one. Currently I have 3 tables: Product(id, title, price) Item(id, product_id, order_id, quantity) Order(id, amount, paid) In pgAdmin I have removed a few order entries, but the items

Re: [GENERAL] a LEFT JOIN problem

2008-10-26 Thread Thomas
Hi Tony, You nailed it! That's the piece of the puzzle I was missing. Moving the filtering inside the ON clause was the solution. -- 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] How to tell PostgreSQL about a relationship

2008-10-26 Thread Thomas
Super! Thank you Hubert and Niklas. -- 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] a LEFT JOIN problem

2008-10-27 Thread Thomas
Unfortunately, I cannot use >= in the ON clause when making a search on a date range. -- 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] How to know the password for the user 'postgres'

2008-10-28 Thread Thomas
An easy trick I have found to set postgres password: $ sudo passwd postgres, and now you can type a new password. So now you can switch user with: $ su postgres, and then connect to the DB with psql. Beware of pg_hba.conf, it is a bit tricky to understand how the mechanism of authentification work

Re: [GENERAL] How to know the password for the user 'postgres'

2008-10-28 Thread Thomas
Yes this allows to login remotely through ssh for instance. But it doesn't offer a bigger backdoor than having a weak password on a sudo account. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-ge

Re: [GENERAL] Can't restart Postgres

2008-10-30 Thread Thomas
I myself noticed that if a client is still connected to the DB server, then PgSQL won't restart. Are you sure all your clients are/were disconnected? I myself have the DB on remote a virtual machine. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your sub

Re: [GENERAL] a LEFT JOIN problem

2008-10-30 Thread Thomas
For some reason, I now can include the date range search in my ON (...) clause. However I would like to know if there is a limit to the number of conditions I can put. It seems that more than 2 conditions misses some records. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org)

Re: [GENERAL] a LEFT JOIN problem

2008-10-30 Thread Thomas
Here is the SQL I am working with: -- SELECT products.*, orders.response_code FROM "products" JOIN items ON products.id = items.product_id LEFT OUTER JOIN orders ON (items.order_id = orders.id AND orders.response_code = '0' AND orders.user_id = 2) WHERE (permalink = E'product-1' AND products.site

Re: [GENERAL] a LEFT JOIN problem

2008-10-30 Thread Thomas
Ok I get the problem. It is the LIMIT 1 which was misleading me. If I remove this limit, I get many returned results, some where orders were paid, some where orders were not paid, therefore the LIMIT1 picks the first one, and by chance it lands on an unpaid order. Am I trying to achieve something

Re: [GENERAL] a LEFT JOIN problem

2008-10-30 Thread Thomas
I have found a trick to fool the system: I use an ORDER BY response_code 0 ASC LIMIT 1 As unpaid orders receive a response_code > 0, then necessarily the first record has response_code of 0. However if more and more orders come into the equation, this means PgSQL will have to process more records

[GENERAL] postgres: writer process,what does this process actually do?

2009-12-22 Thread Thomas
Does it write data to data files to make buffer "clean"?if it does ,but I can not find open files from the result of lsof -p PID. -- 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] postgres: writer process,what does this process actually do?

2009-12-22 Thread Thomas
On 12月22日, 下午11时26分, gryz...@gmail.com (Grzegorz Jaśkiewicz) wrote: > On Tue, Dec 22, 2009 at 10:19 AM, Thomas wrote: > > Does it write data to data files to make buffer "clean"?if it > > does ,but I can not find open files from the result of lsof -p > >  PID. >

Re: [GENERAL] postgres: writer process,what does this process actually do?

2009-12-24 Thread Thomas
On Dec 23, 3:44 pm, r...@iol.ie ("Raymond O'Donnell") wrote: > On 23/12/2009 02:56, Thomas wrote: > > > And could you give me some info about postgres internals? Such as > > ebooks or online articles. > > There's quite a bit in the manual: > &g

[GENERAL] /var/lib/pgsql/data/pg_xlog/000000010000000000000000,two process access it ?

2009-12-24 Thread Thomas
I guess PID 19045 write data to the log file first when I insert data into table ,but why did writer process also access the log file ? Could some guy tell me some details ? FYI: postgres: writer process's PID is 18848 . postgres test [local] idle's PID is 19045 . [r...@localhost tmp]# lsof /var/

[GENERAL] does writer process also write data to WAL log files ?

2010-02-28 Thread Thomas
I found not only WAL writer process write data to WAL log files ,but also write process which I thought only write dirty buffer to data file . Could some body tell me the reason?Tks a lot !! -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscriptio

[GENERAL] need some advanced books on Postgres

2010-03-04 Thread Thomas
sigh,I didn't find a book with enough internal topics. -- 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] need some advanced books on Postgres

2010-03-05 Thread Thomas
Good advice ,tks both of you . For database books ,I found so many good books on Oracle,some on mysql,but db2 and postgres, so few. I have to read some books on Oracle for some advanced topics,although oracle and postgres are different ,I also get some useful info from it . I hope postgres will be

[GENERAL] using pg_dump to dump only a schema?

2005-05-31 Thread thomas
't to transfer the data with it. is it possible? and how? today i played a little bit with it, but could not find a proper way with it. the description in the docu didn't helped me either. any solution anyone? thanx in advance! bye, thomas ---(e

[GENERAL] Postgresqlism & Vacuum?

2000-04-13 Thread Thomas
'optimize' for special cases when the table is small to save micro-seconds? Thomas

Re: [GENERAL] Problem JDBC, AutoCommit ON and SELECT FOR UPDATE

2015-03-06 Thread Thomas Kellerer
fit together. What's the point in locking something if at the end of the statement (=control is returned to the caller) the lock will be released anyway. I'm surprised this works in Oracle actually. Thomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make

Re: [GENERAL] Basic Question on Point In Time Recovery

2015-03-12 Thread Thomas Kellerer
in 9.0) In 9.x you can start the slave as a "hot standby" to allow read only queries which is what pg_dump needs. You should really upgrade to a current version 9.4 or 9.3 Thomas -- 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] Name spacing functions and stored procedures

2015-03-19 Thread Thomas Kellerer
Tim Uckun schrieb am 19.03.2015 um 11:03: > I guess I see schemas as ways to group data not functions. A schema is just a namespace. The only "link" between data and a schema is that data can only live in tables and a table is associated with a namespace. Even if you use it to "group data", yo

Re: [GENERAL] Errors using JDBC batchUpdate with plpgsql function

2015-05-04 Thread Thomas Kellerer
Hannes Erven schrieb am 04.05.2015 um 12:31: > Hi, > > >> String sql = "select test_user_result_insert_func(?, ?, ?);"; > > You can't call functions via JDBC like that. That's perfectly valid - unless the function uses out parameters or ref cursors. I am however unsure about batche

Re: [GENERAL] count distinct and group by

2015-05-07 Thread Thomas Kellerer
Geoff Winkless schrieb am 07.05.2015 um 12:39: > in Postgres (unlike MySQL) you can't order a list of values by a column you > haven't selected.​ Of course you can, just not when you are aggregating. -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to you

Re: [GENERAL]

2015-05-18 Thread Thomas Kellerer
ease-9-1-15.html Thomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Documentation bug?

2015-05-19 Thread Thomas Kellerer
-array.html Is that an oversight in the documentation or isn't the minus supposed to work like that in the first place? Regards Thomas -- 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] Documentation bug?

2015-05-19 Thread Thomas Kellerer
very likely have an intarray extension installed​:​ > http://www.postgresql.org/docs/9.4/interactive/intarray.html > int[] - int operator documented in the extension documentation as it's a > part of the extension but not part of the PostgreSQL core.​ Ah, right - that was it. Completel

Re: [GENERAL] date with month and year

2015-05-21 Thread Thomas Kellerer
Brian Dunavant wrote on 21.05.2015 21:51: It's probably worth noting that both the Ruby 'best practice' AND Postgres have a failure case when dealing with future dates precisely because they are storing the data as UTC with a time zone. This is one case where storing the data WITHOUT TIME ZONE w

[GENERAL] Re: Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-23 Thread Thomas Kellerer
Bill Moran wrote on 22.05.2015 18:57: Arrgh ... it's good that you're bringing this up, but you're making me realize that there's more to figure out than I originally thought ... My focus had been on it being used for BYTEA columns, but there _are_ plenty of places in the code that do things like

[GENERAL] Re: Allowing postgresql to accept 0xff syntax for data types that it makes sense for?

2015-05-23 Thread Thomas Kellerer
Tom Lane wrote on 21.05.2015 19:57: One large concern about doing anything like this is whether future versions of the SQL standard might blindside us with some not-terribly-compatible interpretation of that syntax. If we do something that is also in Oracle or DB2 or one of the other big boys, t

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-28 Thread Thomas Munro
l propagate the bogus > datminmxid = 1 setting into shared memory. Ah! > [...] > > - There's a third possible problem related to boundary cases in > SlruScanDirCbRemoveMembers, but I don't understand that one well > enough to explain it. Maybe Thomas can jump in here a

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-29 Thread Thomas Munro
eaders (updating, locking or vacuuming). If you have truncated multixacts referenced in your tuples then you have a different form of corruption than the pg_upgrade-tramples-on-oldestMultiXactId case we're trying to handle gracefully here. -- Thomas Munro http://www.enterprisedb.com tolerate-missing-offset-segments-wip.patch Description: Binary data -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-05-29 Thread Thomas Munro
ltixacts was copied. I haven't managed to get this to work (ie produce a FATAL) and I'm out of time for a little while, but wanted to share this idea in case it helps someone. -- Thomas Munro http://www.enterprisedb.com -- 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] odbc to emulate mysql for end programs

2015-06-02 Thread Thomas Kellerer
Mimiko schrieb am 02.06.2015 um 13:16: > 1) mysql widelly uses case-insensitive naming for > schemas,tables,columns. So does Postgres. FOO, foo and Foo are all the same name > But postgres use case-sensitive when doulbe-quoting Which is what the SQL standard requires (and this was required *lo

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-02 Thread Thomas Munro
ster). I have also been considering a scenario where multixact ID wraparound occurs during basebackup with some ordering that causes trouble, but I don't yet see why it would break if you replay the WAL from the backup label checkpoint (and I think the repro would take days/weeks to run...) -

Re: [HACKERS] Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Thomas Munro
On Wed, Jun 3, 2015 at 3:42 PM, Alvaro Herrera wrote: > Thomas Munro wrote: >> On Tue, Jun 2, 2015 at 9:30 AM, Alvaro Herrera >> wrote: >> > My guess is that the file existed, and perhaps had one or more pages, >> > but the wanted page doesn't exis

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-03 Thread Thomas Munro
f transaction 131072 DETAIL: Could not open file "pg_multixact/offsets/0002": No such file or directory. But, yeah, this isn't the bug we're looking for. -- Thomas Munro http://www.enterprisedb.com checkpoint-page-boundary.sh Description: Bourne shell script checkpoint-segme

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-04 Thread Thomas Munro
http://www.postgresql.org/message-id/CAEepm=1_KbHGbmPVmkUGE5qTP+B4efoCJYS0unGo-Mc5NV=u...@mail.gmail.com I see the following during shutdown checkpoint: LOG: could not truncate directory "pg_multixact/offsets": apparent wraparound That message comes from SimpleLruTruncate. -- Thomas Munro http://www.enterprisedb.com -- 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] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-04 Thread Thomas Munro
On Fri, Jun 5, 2015 at 11:47 AM, Thomas Munro wrote: > On Fri, Jun 5, 2015 at 9:29 AM, Robert Haas wrote: >> Here's a new version with some more fixes and improvements: >> >> - SetOffsetVacuumLimit was failing to set MultiXactState->oldestOffset >> when the ol

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-05 Thread Thomas Munro
On Fri, Jun 5, 2015 at 1:47 PM, Thomas Munro wrote: > On Fri, Jun 5, 2015 at 11:47 AM, Thomas Munro > wrote: >> On Fri, Jun 5, 2015 at 9:29 AM, Robert Haas wrote: >>> Here's a new version with some more fixes and improvements: >>> [...] >>

Re: [GENERAL] 9.4.1 -> 9.4.2 problem: could not access status of transaction 1

2015-06-16 Thread Thomas Munro
On Wed, Jun 17, 2015 at 6:58 AM, Alvaro Herrera wrote: > Thomas Munro wrote: > >> Thanks. As mentioned elsewhere in the thread, I discovered that the >> same problem exists for page boundaries, with a different error >> message. I've tried the attached repro s

Re: [GENERAL] Select query regarding info

2015-06-18 Thread Thomas Kellerer
& replace. Thomas -- 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] Synchronous replication and read consistency

2015-07-29 Thread Thomas Kellerer
ation-pgPool-not-all-transactions-immediately-visible-on-standby-tp5820275.html Regards Thomas -- 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] PostgreSQL Developer Best Practices

2015-08-23 Thread Thomas Kellerer
he error log with annoying warnings. I strongly disagree: the error is not "annoying" and the statement _should_ fail. The only way you can make the developers stop using that non-standard syntax is to make the satement fail. Thomas -- Sent via pgsql-general mailing list (pgsq

Re: [GENERAL] PostgreSQL Developer Best Practices

2015-08-23 Thread Thomas Kellerer
r rollback to avoid that. I do agree with the "end all queries with a semi-colon" rule, but the explanation is wrong. You should have another rule that says: End all transactions as soon as possible using commit or rollback. Thomas -- Sent via pgsql-general mailing lis

Re: [GENERAL] Serial initial and incremental value

2015-09-02 Thread Thomas Kellerer
FarjadFarid(ChkNet) schrieb am 02.09.2015 um 11:05: > How can I obtain the initial and incremental value of a serial entity? You can use: select * from sequence_name; where "sequence_name" is the name of the sequence associated with your column. Thomas -- Sent via

Re: [GENERAL] get first and last row in one sql as two columns

2015-09-03 Thread Thomas Kellerer
Tom Smith schrieb am 03.09.2015 um 14:11: >> >> SELECT first_value(col1) over (order by col1), >>last_value(col1) over (order by col1) >> FROM table; >> > The window function works for me (with adding limit 1 in the end to output > only one row > needed instead of many dupl

Re: [GENERAL] Listen/notify, equivalents on other DBs

2015-09-26 Thread Thomas Kellerer
Mark Morgan Lloyd schrieb am 25.09.2015 um 23:41: I'm trying to get support for PostgreSQL's listen/notify into a development environment, but since it supports multiple database backends: can anybody comment on how many other servers have a comparable facility? Minimal research has allowed me t

Re: [GENERAL] Replication with 9.4

2015-10-05 Thread Thomas Munro
>> latency in case of let's say 100 hot standby. >> it was an idea, a concept to let the master write and update the nodes, like >> a queen bee ;) >> but I'm afraid it's not possible, so maybe future version of pg will do it, >> for now read from the master

Re: [GENERAL] Issues with german locale on CentOS 5,6,7

2015-10-07 Thread Thomas Kellerer
is left to the OS. Because it essentially means that that exactly the same query with exactly the same data might return a different result if run on different OS Thomas -- 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] Issues with german locale on CentOS 5,6,7

2015-10-07 Thread Thomas Munro
e md5 checksums of the /usr/lib/locale/*/LC_COLLATE files or the version of installed locale packages and automatically reindex things when they change (I guess after restarting the cluster to clear any glibc caches that might be lurking in long running backends). Or at least tell me that's needed. Obvi

Re: [GENERAL] Issues with german locale on CentOS 5,6,7

2015-10-07 Thread Thomas Munro
On Thu, Oct 8, 2015 at 1:16 PM, Peter Geoghegan wrote: > On Wed, Oct 7, 2015 at 4:49 PM, Thomas Munro > wrote: >>> I agree that that would be almost as bad as carrying on, because there >>> is no reason to think that the locale thing can easily be rolled back. >&g

Re: [GENERAL] Best practices for aggregate table design

2015-10-07 Thread Thomas Kellerer
droberts schrieb am 06.10.2015 um 20:53: > Okay, so is it safe to say I should use loosely use these guidelines when > deciding whether to model an attribute as a dimension > (type=[inbound,outbound]) vs. bundling with a measure (total_inbound) ? > > If you know the number of values for a dimensio

Re: [GENERAL] PSQL Tools

2015-10-18 Thread Thomas Kellerer
jwienc...@comcast.net schrieb am 18.10.2015 um 16:04: Is anyone aware of any tools like TOAD that are available for Postgresql? https://wiki.postgresql.org/wiki/Community_Guide_to_PostgreSQL_GUI_Tools -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to y

Re: [GENERAL] A question about PL/pgSQL DECLAREd variable behavior

2015-10-21 Thread Thomas Munro
to the first row returned by the query, or to nulls if the query returned no rows." -- Thomas Munro http://www.enterprisedb.com -- 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] A question about PL/pgSQL DECLAREd variable behavior

2015-10-22 Thread Thomas Munro
pecial case. Other constructs that have special behaviour for NULL don't consider a composite type composed of NULLs to be NULL. For example IS DISTINCT FROM, COALESCE, COUNT, STRICT functions. -- Thomas Munro http://www.enterprisedb.com -- 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] A question about PL/pgSQL DECLAREd variable behavior

2015-10-22 Thread Thomas Munro
On Fri, Oct 23, 2015 at 12:33 PM, Dane Foster wrote: > On Thu, Oct 22, 2015 at 6:54 PM, Thomas Munro > wrote: >> >> On Fri, Oct 23, 2015 at 10:27 AM, Dane Foster wrote: >> > On Thu, Oct 22, 2015 at 2:00 PM, Jim Nasby >> > wrote: >>

Re: [GENERAL] Recursive Arrays 101

2015-10-26 Thread Thomas Kellerer
Alban Hertroys schrieb am 25.10.2015 um 22:07: > WITH RECURSIVE taxons AS ( > -- Hierarchical root nodes > SELECT N AS id, Taxon, Rank, 1 AS level, '' || N AS Path -- A useful > addition explained further down > FROM t > WHERE ParentID IS NULL > > -- Child nodes > UNION

Re: [GENERAL] Configure Different Databases on One Server

2015-10-29 Thread Thomas Kellerer
Jim Longwill schrieb am 29.10.2015 um 22:43: Ok. The reason I wanted to experiment with autovacuum disable for 'ddev2' database is that it is a mostly read-only database -- to support querying from our web apps. I.e. there are only 1 or 2 small tables ever updated all day on it, and only about

Re: [GENERAL] Is there bigintarray?

2015-11-02 Thread Thomas Kellerer
Igor Bossenko schrieb am 02.11.2015 um 14:20: What is the current plans for bigintarray? Igor The following works for me: create table foo ( bia bigint[] ); -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www

Re: [GENERAL] Query regarding

2015-11-04 Thread Thomas Kellerer
M Tarkeshwar Rao schrieb am 04.11.2015 um 10:21: > Hi all, > > We have started to convert some oracle sql scripts and converting them to > postgres, but facing some issues to create table. > > I have some common doubts in create table script ie. > > ALTER TABLE employee > DROP PRIMARY KEY CA

Re: [GENERAL] is there any difference DROP PRIMARY KEY in oracle and postgres?

2015-11-05 Thread Thomas Kellerer
M Tarkeshwar Rao schrieb am 06.11.2015 um 04:52: > one thing in oracle is there any difference between “DROP PRIMARY > KEY” used directly in oracle to drop primary key, or “DROP CONSTRAINT > CDRAUDITPOINT_pk”, as first syntax is not available in postgres and > we need to give primary key name as co

Re: [GENERAL] Does PostgreSQL ever create indexes on its own?

2015-11-12 Thread Thomas Kellerer
Doiron, Daniel schrieb am 12.11.2015 um 23:21: I’m troubleshooting a schema and found this: Indexes: "pk_patient_diagnoses" PRIMARY KEY, btree (id) "index_4341548" UNIQUE, btree (id) "idx_patient_diagnoses_deleted" btree (deleted) "idx_patient_diagnoses_diagnosis_type_id" btr

Re: [GENERAL] Issues with german locale on CentOS 5,6,7

2015-11-12 Thread Thomas Munro
On Thu, Oct 8, 2015 at 12:49 PM, Thomas Munro wrote: > On Thu, Oct 8, 2015 at 5:52 AM, Peter Geoghegan > wrote: > > On Wed, Oct 7, 2015 at 6:25 AM, Tom Lane wrote: > >> The only real way out of such a situation is to REINDEX affected > indexes. > >> Refu

Re: [GENERAL] Does PostgreSQL ever create indexes on its own?

2015-11-13 Thread Thomas Kellerer
t; We are not Oracle. Well, Oracle does not create indexes on its own either - it has the same strategy as Postgres: Indexes are only created automatically for primary keys and unique constraints. Thomas -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes

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

2016-06-05 Thread Thomas Kellerer
Sachin Srivastava schrieb am 05.06.2016 um 11:16: Kindly inform to me How PostgreSQL Processes SQL Statements internally? How SQL SELECT * statement works in Postgres? Check out Bruce's presentations: htt

[GENERAL] pgAdmin 4 beta not working on Windows 10

2016-06-11 Thread Thomas Kellerer
Dave Page schrieb am 10.06.2016 um 16:48: I'm pleased to announce that the release of pgAdmin 4 v1.0 Beta 1 for testing. You can find more details on the website: Announcement: https://www.pgadmin.org/ Documentation: https://www.pgadmin.org/docs4/dev/index.html Downloads: https://www.pgadmin.o

[GENERAL] Re: Moving from PHP to Java: A result was returned when none was expected.

2016-06-15 Thread Thomas Kellerer
Alexander Farber schrieb am 15.06.2016 um 15:56: > Good afternoon, > > at PostgreSQL 9.5.3 I have a stored function (full source code below) > returning void, which I successfully call with PHP: > > function skipGame($dbh, $uid, $gid) { > $sth = $dbh->prepare('SELECT words_skip_game(?, ?

Re: [GENERAL] Transaction serialization

2016-06-23 Thread Thomas Munro
dependencies among transactions DETAIL: Reason code: Canceled on identification as a pivot, during write. HINT: The transaction might succeed if retried. -- Thomas Munro http://www.enterprisedb.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your

[GENERAL] 9.6 beta2 win-x64 download links still point to beta1

2016-06-23 Thread Thomas Kellerer
Hello, the Beta2 downloads on http://www.enterprisedb.com/products-services-training/pgdownload http://www.enterprisedb.com/products-services-training/pgbindownload still lead to Beta1 for the Windows 64bit builds. All others properly link to beta1 Thomas -- Sent via pgsql-general

Re: [GENERAL] 9.6 beta2 win-x64 download links still point to beta1

2016-07-01 Thread Thomas Kellerer
Bruce Momjian schrieb am 28.06.2016 um 05:36: On Fri, Jun 24, 2016 at 07:44:17AM +0200, Thomas Kellerer wrote: the Beta2 downloads on http://www.enterprisedb.com/products-services-training/pgdownload http://www.enterprisedb.com/products-services-training/pgbindownload still lead to

[GENERAL] Re: Best way to insert a row with two columns having the value based on the same argument generated by another postgres function.

2016-07-07 Thread Thomas Kellerer
Silk Parrot schrieb am 07.07.2016 um 08:56: > Hi, > >I am trying to build a user database. The steps for creating a new user > are: > > 1. Use gen_salt to create a salt. > 2. Compute the hash based on the salt and password and store both the hash > and the salt into a new row. > > > The

[GENERAL] low perfomances migrating from 9.3 to 9.5

2016-07-27 Thread thomas veymont
hello all, We switched from PostgreSQL server 9.3 to 9.5. From the very beginning there was a noticeable drop in performances (for example : when injecting our SQL dumps into 9.5, COPY and CREATE INDEX were very slow). Our configuration file was the same for 9.3 and 9.5, except for the "chekpoint

Re: [GENERAL] low perfomances migrating from 9.3 to 9.5

2016-07-27 Thread thomas veymont
2016-07-27 11:06 GMT+02:00 Michael Paquier : > On Wed, Jul 27, 2016 at 5:54 PM, thomas veymont > wrote: > > We switched from PostgreSQL server 9.3 to 9.5. From the very beginning > there > > was a noticeable drop in performances (for example : when injecting our > SQL

Re: [GENERAL] low perfomances migrating from 9.3 to 9.5

2016-07-27 Thread thomas veymont
2016-07-27 14:11 GMT+02:00 Michael Paquier : > > > And do you see changes if you increase min_wal_size? This will > increase the number of WAL segments recycled instead of removed at > each checkpoint. > -- > Michael > I have seen no improvment with the following parameters in 9.5: max_wal_size =

Re: [GENERAL] Locking issue

2016-07-27 Thread Thomas Munro
sits on top and only gets its hands on tuples emitted by nodes below it, so if there is a LIMIT then how could it lock anything outside the limited set of rows that are returned? -- Thomas Munro http://www.enterprisedb.com -- 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] low perfomances migrating from 9.3 to 9.5

2016-07-28 Thread thomas veymont
it's machine/OS dependant or even I am doing my test the wrong way. I will be back to you with more objective values by next week. thanks for helping, Tom 2016-07-27 17:14 GMT+02:00 Melvin Davidson : > > > On Wed, Jul 27, 2016 at 11:01 AM, Adrian Klaver > wrote: &

Re: [GENERAL] Allowing multiple versions of PG under NetBSD

2016-07-29 Thread Thomas Munro
cluster 9.5/main. The client library on the other hand would not be versioned in that way: there would be just the latest major version's libpq5[2], and that is what other things like py-psycopg2 etc would depend on (instead of depending on a specific client major version l

[GENERAL] PG vs ElasticSearch for Logs

2016-08-19 Thread Thomas Güttler
beats for postgres. We use it since several years. On the other hand, the sentence "Don't store logs in a DB" is somewhere in my head. What do you think? -- Thomas Guettler http://www.thomas-guettler.de/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org

Re: [GENERAL] PG vs ElasticSearch for Logs

2016-08-19 Thread Thomas Güttler
Am 19.08.2016 um 09:42 schrieb John R Pierce: On 8/19/2016 12:32 AM, Thomas Güttler wrote: What do you think? I store most of my logs in flat textfiles syslog style, and use grep for adhoc querying. 200K rows/day, thats 1.4 million/week, 6 million/month, pretty soon you're talkin

Re: [GENERAL] PG vs ElasticSearch for Logs

2016-08-19 Thread Thomas Güttler
Am 19.08.2016 um 11:21 schrieb Sameer Kumar: On Fri, Aug 19, 2016 at 4:58 PM Thomas Güttler mailto:guettl...@thomas-guettler.de>> wrote: Am 19.08.2016 um 09:42 schrieb John R Pierce: > On 8/19/2016 12:32 AM, Thomas Güttler wrote: >> What do you think? >

Re: [GENERAL] PG vs ElasticSearch for Logs

2016-08-19 Thread Thomas Güttler
Am 19.08.2016 um 12:44 schrieb Andreas Kretschmer: Thomas Güttler wrote: How will you be using the logs? What kind of queries? What kind of searches? Correlating events and logs from various sources could be really easy with joins, count and summary operations. Wishes raise with

Re: [GENERAL] PG vs ElasticSearch for Logs

2016-08-22 Thread Thomas Güttler
Thank you Chris for looking at my issue in such detail. Yes, the parallel feature rocks. Regards, Thomas Güttler Am 19.08.2016 um 22:40 schrieb Chris Mair: On 19/08/16 10:57, Thomas Güttler wrote: What do you think? I store most of my logs in flat textfiles syslog style, and use grep

Re: [GENERAL] PG vs ElasticSearch for Logs

2016-08-22 Thread Thomas Güttler
Am 19.08.2016 um 19:59 schrieb Andy Colson: On 8/19/2016 2:32 AM, Thomas Güttler wrote: I want to store logs in a simple table. Here my columns: Primary-key (auto generated) timestamp host service-on-host loglevel msg json (optional) I am unsure which DB to choose: Postgres

[GENERAL] ElasticSearch Beats

2016-08-24 Thread Thomas Güttler
ipedia.org/wiki/Reliable_Event_Logging_Protocol Regards, Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] Graylog

2016-08-24 Thread Thomas Güttler
well. It could well be overkill for your needs, but I don't know what your environment looks like. Thank you for this hint. I will look at it. Regards, Thomas Güttler -- Thomas Guettler http://www.thomas-guettler.de/ -- Sent via pgsql-general mailing list (pgsql-general@postgresql.or

[GENERAL] Re: Clustered index to preserve data locality in a multitenant application?

2016-08-30 Thread Thomas Kellerer
Nicolas Grilly schrieb am 30.08.2016 um 13:12: > We rely on clustered indexes to preserve data locality for each > tenant. Primary keys start with the tenant ID. This way, rows > belonging to the same tenant are stored next to each other. Because > all requests hit only one tenant, this is a great

Re: [GENERAL] Chante domain type - Postgres 9.2

2016-09-26 Thread Thomas Kellerer
Rakesh Kumar schrieb am 26.09.2016 um 15:08: >>You sound like you think that varchar(50) is somehow cheaper than text. > > The biggest impediment to text cols in other RDBMS is no index allowed. > If PG has an elegant solution to that, then yes I see the point made by the > original poster. Don

Re: [GENERAL] isnull() function in pgAdmin3

2016-09-28 Thread Thomas Kellerer
dudedoe01 schrieb am 27.09.2016 um 19:04: > I am trying to emulate the isnull() function used in MySQL into postreSQL. I > have tried different ways such is null but it's not producing the results > desired. I am doing a data migration from MySQL into postgreSQL and need > help with the isnull() in

Re: [GENERAL] Time travel?

2016-09-29 Thread Thomas Munro
t; time. Apparently some filesystems change the ctime for rename and others don't, and POSIX tolerates both. -- Thomas Munro http://www.enterprisedb.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general

[GENERAL] pg_upgrade from 9.5 to 9.6 fails with "invalid argument"

2016-09-29 Thread Thomas Kellerer
/Daten/db/pgdata95/base/16410/85358_vm" to "d:/Daten/db/pgdata96/base/16411/85358_vm" error while copying relation "public.wb_downloads" ("d:/Daten/db/pgdata95/base/16410/85358_vm" to "d:/Daten/db/pgdata96/base/16411/85358_vm"): Invalid argument F

Re: [GENERAL] pg_upgrade from 9.5 to 9.6 fails with "invalid argument"

2016-09-29 Thread Thomas Kellerer
Adrian Klaver schrieb am 29.09.2016 um 22:55: After running a "vacuum full" on the table in question the upgrade goes through. Assuming you did that on old cluster? Yes, correct. I did that on the 9.5 cluster Where both clusters installed the same way? Yes. I always download the ZIP Arch

Re: [GENERAL] pg_upgrade from 9.5 to 9.6 fails with "invalid argument"

2016-09-30 Thread Thomas Kellerer
Tom Lane schrieb am 29.09.2016 um 23:10: > Thomas Kellerer writes: >> for some reason pg_upgrade failed on Windows 10 for me, with an error >> message that one specifc _vm file couldn't be copied. > > Hmm ... a _vm file would go through rewriteVisibilityMap(), which

Re: [GENERAL] postgres failed to start from services manager on windows 2008 r2

2016-10-01 Thread Thomas Kellerer
PHANIKUMAR G schrieb am 01.10.2016 um 17:30: We then tried to start the service with the following changes. a. we changed the "Log on as" type to "This account" b. changed the account name to ".\" c. And entered the password for this account and saved. After that we are able to

Re: [GENERAL] postgresql-8.1.18-2.1 information

2016-10-06 Thread Thomas Munro
> Close as I can come is the source version: > > https://www.postgresql.org/ftp/source/v8.1.18/ Ancient Red Hat source RPMs are apparently still be available for archeology projects though: ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/ (That's "5Server&qu

Re: [GENERAL] import_bytea function

2016-10-07 Thread Thomas Kellerer
t = con.prepareStatement(sql); pstmt.setInt(1, 42); pstmt.setBinaryStream(in, (int)uploaded.length()); pstmt.executeUpdate(); This *only* works with bytea column, not with "large objects". In production code you obviously need to close all resources and handle errors. I left that out for s

  1   2   3   4   5   6   7   8   9   10   >