Re: Why not used standard SQL commands?

2022-01-08 Thread Thomas Kellerer
Ali Koca schrieb am 08.01.2022 um 19:25: I'm seeing \dt used for "show tables", \l used for "show databases". Why not standart SQL syntax words? Why specified PostgreSQL commands? I can't figure out that. The only thing the SQL standard defines to gain access to information about tables, schema

Re: DELETING then INSERTING record with same PK in the same TRANSACTION

2022-02-09 Thread Thomas Kellerer
David G. Johnston schrieb am 09.02.2022 um 21:47: You cannot defer uniqueness checks to transaction commit so either it is going to fail on the insert or it will not fail at all. You can defer unique constraints, but not primary key constraints. create table t ( id integer ); alter table t

Re: Turn a json column into a table

2022-02-14 Thread Thomas Kellerer
Shaozhong SHI schrieb am 15.02.2022 um 07:23: > There is a JSON column in a table. It contains key value pairs, just > like a dictionary. What is the best way to turn this column into a > data table? jsonb_each() is one option: select j.* from the_table t cross join jsonb_each(t.the_c

Re: Strange results when casting string to double

2022-02-17 Thread Thomas Kellerer
Carsten Klein schrieb am 16.02.2022 um 14:27: > I'm using several (now unsupported) PostgreSQL 9.3.24 servers on > different (ancient) Ubuntu 14.04 LTS machines. On only one of those > servers, I get strange/wrong results when converting a string into a > double value: > > SELECT 1.56::double preci

Re: Reset Sequence number

2017-11-22 Thread Thomas Kellerer
Brahmam Eswar schrieb am 22.11.2017 um 10:36: > > we are in process of migrating to postgres and need to reset the > sequence number with highest value of table key. I want to make it > procedural to do that as mentioned below, But it's throwing an error > DO $$ >  DECLARE >  SEQ BIGINT; >  BEGIN

Re: Does Postgresql 10 query partitions in parallel?

2017-12-06 Thread Thomas Kellerer
John R Pierce schrieb am 06.12.2017 um 20:34: PostgreSQL 10 does indeed have a parallel query feature that will use multiple cores.  you have to explicity invoke it. "you have to explicitly invoke it" - huh? oops, I meant, enable. You are correct for 9.6 where the default was "disabled", bu

Re: Does Postgresql 10 query partitions in parallel?

2017-12-06 Thread Thomas Kellerer
Maltsev Eduard schrieb am 06.12.2017 um 14:11: I'm curious if the new feature of Postgresql allows to take advantage of multiple cpus on server, and multiple servers (fdw), for larger read only queries (Data mining). In general there should be some worker that queries partitions and merges the re

Re: PG Schema to be used as log and monitoring store

2017-12-10 Thread Thomas Kellerer
I actually made some tests on my own (using generate_series) and did not find any disk space or performance issues yet. I've also found this paper from 2012 about "Sensor Data Storage Performance: SQL or NoSQL, Physical or Virtual" [2] which confirms my observations. Now, you have to know that t

Re: Converting timestamp to timestamptz without rewriting tables

2017-12-18 Thread Thomas Kellerer
Tom Dunstan schrieb am 18.12.2017 um 09:08: > We have generally been using timestamps without timezones in our > system. As both our app servers and db server were set to UTC it so > far hasn't been an issue. However, that may not always be the case, > so we want to tighten things up a bit. We are

Re: MSSQL compatibility layer

2018-01-02 Thread Thomas Kellerer
James Harper schrieb am 02.01.2018 um 12:24: Right now the code is pretty rough. I've only implemented bits and pieces to a proof of concept stage so it's definitely way off being useful. At the moment the following pieces are in place: . BackgroundWorker listening on port 1433 (hardcoded - I ha

Re: Supartitions in PGSQL 10

2018-01-08 Thread Thomas Kellerer
Kumar, Virendra schrieb am 08.01.2018 um 22:12: Can you please let us know if Sub-partitions are supported in PGSQL (declarative partitions) 10.1. If yes can it be list-list partitions. We have a situation where a table is very big having around 2 billion rows and is growing. We want to use parti

Re: Alter view with dependence without drop view!

2018-01-30 Thread Thomas Kellerer
Elson Vaz schrieb am 30.01.2018 um 14:40: Hello! I want make change in one view that have dependence view's, so when i try to make change i'm block because of this, what is the best solution?? This can easily be dealt with when using a schema management tool. We use Liquibase for this and t

Re: DOW is 0-based?

2018-02-08 Thread Thomas Kellerer
Igal @ Lucee.org schrieb am 08.02.2018 um 21:24: > Is there a rational reason why Day of the Week is 0-based, i.e. Sunday (0) to > Saturday (6) instead of the more intuitive Sunday (1) to Saturday (7)? Actually, the more intuitive (in this part of the world) would be: Monday = 1, Sunday = 7 ;)

Re: Database health check/auditing

2018-02-15 Thread Thomas Kellerer
Melvin Davidson schrieb am 16.02.2018 um 05:26: > Tim, > > FYI, the policy in this list is to avoid top posting and bottom post instead. Plus: trimming the original content, so that not the whole email thread is repeated in the quote. Thomas

Re: Database health check/auditing

2018-02-16 Thread Thomas Kellerer
situation: I have just commenced a DBA and developer role for an organisation with a number of Postgres databases (9.4 and 9.6 versions). There has been no dedicated DBA and a number of the databases were setup by people with little to know Postgres or database experience. I need to get an overvie

Re: Creating complex track changes database - challenge!

2018-02-26 Thread Thomas Kellerer
Łukasz Jarych schrieb am 26.02.2018 um 11:44: > i would like to ask you for help with track changes to my database.  > I am new to PosgtreeSQL but i have to learn it quickly because of my boss.  > > I have to: > > 1. Keep all changes within table including: > -adding rows > -deleting > -editing >

Re: merge statement gives error

2018-02-26 Thread Thomas Kellerer
Abhra Kar schrieb am 26.02.2018 um 16:02: > Hi, > >        Trying to execute the following statement   > > > merge into ABC as n using dual on (n.id =123) > > when matched update set aaa=222, bbb=333 > >  when not matched insert (id, aaa) values (NEXTVAL(id),555); > > > > b

<    1   2   3   4