Re: Bugs details.

2024-06-04 Thread Erik Wienhold
On 2024-06-04 19:55 +0200, Muhammad Salahuddin Manzoor wrote: > I need to get detailed information about PG bugs and fixes. > > I can get the information about new features and Fixes in the release > document but I find only descriptions for each fix. I need detailed > information about these

Re: Purpose of pg_dump tar archive format?

2024-06-04 Thread Erik Wienhold
On 2024-06-04 14:13 +0200, Ron Johnson wrote: > It doesn't support compression nor restore reordering like the custom > format, so I'm having trouble seeing why it still exists (at least without > a doc warning that it's obsolete). Maybe because of this: > * The tar format also includes a

Re: How to update upper-bound of tstzrange ?

2024-05-20 Thread Erik Wienhold
On 2024-05-20 12:30 +0200, Laura Smith wrote: > Could someone kindly help me out with the correct syntax ? > > My first thought was the below but that doesn't work: > > update foo set upper(bar_times)=upper(bar_times)+interval '1' hour where > bar_id='abc'; > ERROR: syntax error at or near "("

Re: Left join syntax error

2024-05-18 Thread Erik Wienhold
On 2024-05-18 17:12 +0200, David G. Johnston wrote: > Too lazy to find the docs right now but what you are observing is basically > an operator precedence effect. The comma join hasn’t happened at the time > the left join is evaluated and so other tables in the comma join cannot > appear in the

Re: Left join syntax error

2024-05-18 Thread Erik Wienhold
I wrote: > But I wonder if the implicit cross join syntax ("FROM peoples, companies") > should actually produce this error because the explicit cross join > works: > > SELECT p.lname, p.fname, p.job_title, p.company_nbr, p.email, > c.company_name > FROM people as p > CROSS JOIN

Re: Left join syntax error

2024-05-18 Thread Erik Wienhold
On 2024-05-18 15:19 +0200, Shammat wrote: > Am 18.05.24 um 14:52 schrieb Rich Shepard: > > It's been a _very_ long time since I wrote a SQL script and, despite looking > > at my SQL books and web pages, I don't know how to fix the error. > > > > The three line script is: > > - > > SELECT

Re: UTC is not a time zone?

2024-05-13 Thread Erik Wienhold
On 2024-05-13 19:37 +0200, Christophe Pettus wrote: > PostgreSQL 16.3 on MacOS Sonoma. A long-running process (which held a > connection open the entire time) failed with: > > 2024-05-13 09:12:44.719 > PDT,"cyan","cyan",35926,"[local]",664214f9.8c56,3,"SELECT",2024-05-13 > 06:26:17

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread Erik Wienhold
On 2024-04-02 22:08 +0200, sud wrote: > On Tue, Apr 2, 2024 at 7:46 PM Greg Sabino Mullane > wrote: > > Now this block seems to be failing near the "LIKE" operator. Isn't it > allowed to add the check constraints along with the CREATE TABLE statement? > > [...] > > EXECUTE format(' >

Re: Timestamp conversion Error in dynamic sql script

2024-04-02 Thread Erik Wienhold
On 2024-04-02 07:38 +0200, sud wrote: > I am trying to create a block which will create a few partitions > dynamically and also insert ~1million rows into each of those partitions. > Not able to figure out why it's giving below error during timezone > conversion while defining the partitions even

Re: Grants and privileges issue

2024-03-28 Thread Erik Wienhold
On 2024-03-28 22:43 +0100, sud wrote: > Regarding my second question, I am still unable to find out why we are > seeing "*no privileges were granted for cron/partman/part_config*' message > while adding the grants to the user? Because the role that is granting the privileges is missing the grant

Re: Empty materialized view

2024-03-24 Thread Erik Wienhold
On 2024-03-24 19:12 +0100, Thiemo Kellner wrote: > I have created a materialized view with "with data". And I refreshed it with > "with data". The query of the mv returns records when executed outside the > mv. I would appreciate help with respect to what I miss that my mv is empty. Maybe you

Re: Is this a buggy behavior?

2024-03-24 Thread Erik Wienhold
On 2024-03-24 16:28 +0100, Thiemo Kellner wrote: > Am 24.03.2024 um 16:17 schrieb Tom Lane: > > > To do that, we'd have to remember that you'd said NULL, which we > > don't: the word is just discarded as a noise clause. Considering > > that this usage of NULL isn't even permitted by the SQL

Re: Is this a buggy behavior?

2024-03-24 Thread Erik Wienhold
I wrote: > Do you come from sqlite? That allows NULL in primary key columns > without an explicit NOT NULL constraint. And that's also possible in Postgres with UNIQUE constraints if you're looking for that behavior. -- Erik

Re: Is this a buggy behavior?

2024-03-24 Thread Erik Wienhold
On 2024-03-24 15:25 +0100, sud wrote: > Create a table and composite primary key. But to my surprise it allowed me > to have the composite primary key created even if one of the columns was > defined as nullable. But then inserting the NULL into that column erroring > out at the first record

Re: Dropping a temporary view?

2024-03-20 Thread Erik Wienhold
On 2024-03-20 15:58 +0100, Celia McInnis wrote: > I am using postresql 16, am trying to use temporary views in a piece of > software that I am writing, and would like it to be able to drop and > recreate temporary views. It seems from the documentation that I can only > use "CREATE OR REPLACE

Re: SSL error on install of PEM during Posgres install

2024-03-20 Thread Erik Wienhold
Hi Mark, On 2024-03-20 14:26 +0100, mark bradley wrote: > I am getting the following error message during install of PEM while > installing Posgres. > > [cid:da2b6d5e-c3b0-430a-98e0-dac72d0aba23] Please include error messages as plain text. For reference, screenshot says: "psql: error:

Re: Excel Source [24]] Error: System.Exception: SqlTruncateException: Numeric arithmetic causes

2024-02-29 Thread Erik Wienhold
"Metric Value" character varying(510) COLLATE > > pg_catalog."default", and Decimal/Numeric. Did you get the same error with the text columns? In plain SQL you can certainly insert numeric into text columns. Postgres does an implicit cast in that case. Not sure what your middle

Re: Excel Source [24]] Error: System.Exception: SqlTruncateException: Numeric arithmetic causes

2024-02-28 Thread Erik Wienhold
On 2024-02-28 21:22 +0100, Anthony Apollis wrote: > Please assist. I am using SSIS to read data from an Excel sheet into > Postgres. I have increased the column size a few times, just cant seem to > get the data in. Getting errors relating to destination column size. What is the data type of that

Re: Documentation diff

2024-02-25 Thread Erik Wienhold
On 2024-02-25 17:38 +0100, Marcos Pegoraro wrote: > All the time we have doubts about what function exists in what version, or > was changed. pgPedia may give you some overview, although it does not claim to be up-to-date. > IS JSON belongs to 15 or 16, MERGE was done on 14 or 15, as example,

Re: How to schema-qualify "IS DISTINCT FROM" on trigger definition? (I created a db that cannot be dump/restored)

2024-02-22 Thread Erik Wienhold
On 2024-02-22 22:14 +0100, Vick Khera wrote: > On Wed, Feb 21, 2024 at 4:27 PM Tom Lane wrote: > > > For the moment, I think the only feasible solution is for your trigger > > function to set the search path it needs by adding a "SET search_path > > = whatever" clause to the function's CREATE

Re: Partial table duplication via triggger

2024-02-22 Thread Erik Wienhold
On 2024-02-22 15:14 +0100, Moreno Andreo wrote: > suppose I have 2 tables > > CREATE TABLE t1( >     id uuid, >     name text, >     surname text, >     ... >     PRIMARY KEY(id) > ) > > CREATE TABLE t2( >     id uuid, >     master_id uuid, >     op_ts timestamp with time zone, >     name text,

Re: array_to_json/array_agg question

2024-02-20 Thread Erik Wienhold
On 2024-02-20 10:48 +0100, Laura Smith wrote: > Before I go down the road of taking care of this in the front-end > through iterations, I thought I would ask the pgsql if there was a > clever query I could do on postgres that would take care of it for me > instead. > > In essence, I would like to

Re: PostgreSQL DB in prod, test, debug

2024-02-14 Thread Erik Wienhold
On 2024-02-14 10:59 +0100, Simon Connah wrote: > This project uses Python 3.12, Flask, psycopg3 and PostgreSQL 15. > > This is probably a stupid question so I apologies in advance. > > I'm building a website using PostgreSQL and since I've just been doing > some dev work on it I've just manually

Re: unbale to list schema

2024-01-17 Thread Erik Wienhold
On 2024-01-17 19:46 +0100, Atul Kumar wrote: > I am not able to find any solution to list all schemas in all databases at > once, to check the structure of the whole cluster. You have to connect to each database and run the necessary statements per database. > As I need to give a few privileges

Re: Get back the number of columns of a result-set prior to JSON aggregation

2023-11-28 Thread Erik Wienhold
On 2023-11-28 13:12 +0100, Dominique Devienne wrote: > Hi. I've got a nice little POC using PostgreSQL to implement a REST API > server. > This uses json_agg(t) to generate the JSON of tables (or subqueries in > general), > which means I always get back a single row (and column, before I added the

Re: Feature request: pg_get_tabledef(text)

2023-11-22 Thread Erik Wienhold
On 2023-11-22 16:41 +0100, Hans Schou wrote: > Similar to pg_get_viewdef() and pg_get_functiondef() it would be useful > with a pg_get_tabledef() to get a full description of how a table is > defined. There's already a discussion on that topic[1]. But I don't know about the current state of

Re: How can I return a UTF8 string from a hex representation in a latin9 database?

2023-11-19 Thread Erik Wienhold
On 2023-11-19 21:37 +0100, PGUser2020 wrote: > I have a database for a legacy application that requires an 8 bit > database (i.e. the application itself won't function on a UTF8 > database). Technically speaking, UTF-8 is an 8-bit encoding. But I guess that application would then show mojibake

Re: Is "DISTINCT" making a diffence in: SELECT [DISTINCT] ... EXCEPT

2023-11-15 Thread Erik Wienhold
On 2023-11-15 12:12 +0100, Dimitrios Apostolou wrote: > On Wed, 15 Nov 2023, Erik Wienhold wrote: > > > On 2023-11-15 10:57 +0100, Dimitrios Apostolou wrote: > > > SELECT [DISTINCT] ... EXCEPT ... > > > > > > In this query I get the same r

Re: Is "DISTINCT" making a diffence in: SELECT [DISTINCT] ... EXCEPT

2023-11-15 Thread Erik Wienhold
On 2023-11-15 10:57 +0100, Dimitrios Apostolou wrote: > SELECT [DISTINCT] ... EXCEPT ... > > In this query I get the same results regardless of including DISTINCT or > not. But I get different query plans, I get an extra HashAggregate node > in the case of SELECT DISTINCT. Any idea why? As Tom

Re: JSON fields with backslashes

2023-10-13 Thread Erik Wienhold
On 2023-10-14 00:01 +0200, David G. Johnston write: > On Fri, Oct 13, 2023 at 2:53 PM Greig Wise wrote: > > > Hello. I have run into an issue when using the copy command on tables > > with json columns where Postgres seems to improperly escape backslashes > > under certain conditions thus

Re: Regarding PostgreSQL 15.4

2023-09-27 Thread Erik Wienhold
On 2023-09-27 11:53 +0200, Somnath Som write: > "analyze_new_cluster.sh" this features is available for PostgreSQL version > 15.4 ? No. That was already removed in 14.0. pg_upgrade now just instructs you to run vacuumdb directly. -- Erik

Re: Early binding of CURRENT_SCHEMA (Was: CREATE FUNCTION ... SEARCH {, DEFAULT | SYSTEM | SESSION })

2023-09-26 Thread Erik Wienhold
ccing list On 2023-09-27 00:12 +0200, dld write: > On 26-09-2023 23:47, Erik Wienhold wrote: > > On 2023-09-26 14:44 +0200, dld wrote: > > > I followed the discussion about the schema resolution, and I really think > > > there is need for an early bound (at functi

Re: Early binding of CURRENT_SCHEMA (Was: CREATE FUNCTION ... SEARCH {, DEFAULT | SYSTEM | SESSION })

2023-09-26 Thread Erik Wienhold
On 2023-09-26 14:44 +0200, dld wrote: > I followed the discussion about the schema resolution, and I really think > there is need for an early bound (at function definition time) version of > CURRENT_SCHEMA (the first member of search_path) You mean something like CREATE FUNCTION

Re: Postgres 11.5 not logging all sqls

2023-09-25 Thread Erik Wienhold
On 2023-09-25 16:54 +0530, shashidhar Reddy wrote: > We are using postgres 11.5 on Ubuntu we have enabled logging and set > log_statements to all but when I checked the statements in the logs I can > see only first few lines of the query and also when I check in pgadmin for > current queries I

Re: Accessing system information functions

2023-09-25 Thread Erik Wienhold
On 2023-09-22 17:37 +, Johnson, Bruce E - (bjohnson) wrote: > postgres=# pg_database_size(avi); > ERROR: syntax error at or near "pg_database_size" > LINE 1: pg_database_size(avi); Call functions with SELECT, e.g.: SELECT pg_database_size('avi'); Also, the database name must be a

Re: Changed functionality from 14.3 to 15.3

2023-09-20 Thread Erik Wienhold
On 2023-09-20 17:53 -0400, Michael Corey wrote: > To make matters even more strange. I checked the permissions of > rds_superuser in 15 and 14 > > For 14 > GRANT pg_monitor, pg_signal_backend, rds_password, rds_replication TO > rds_superuser WITH ADMIN OPTION; > > For 15 > GRANT pg_checkpoint,

Re: Changed functionality from 14.3 to 15.3

2023-09-20 Thread Erik Wienhold
On 2023-09-20 15:19 -0400, Michael Corey wrote: > Just to be clear in your last response are you saying on your 14.3 you are > getting the > ERROR: permission denied for table ref_media_code ? Yes: db14=> select version();

Re: Changed functionality from 14.3 to 15.3

2023-09-20 Thread Erik Wienhold
On 2023-09-20 14:24 -0700, David G. Johnston wrote: > On Wed, Sep 20, 2023 at 2:20 PM Erik Wienhold wrote: > > > Has your 14.3 some left-over state from previous test runs? I assume > > the server is not re-created for each test run. I was wondering if the > &g

Re: Changed functionality from 14.3 to 15.3

2023-09-20 Thread Erik Wienhold
On 2023-09-20 13:17 -0400, Michael Corey wrote: > PG 14 Server > psql (14.2, server 14.3) > You are now connected to database "db14" as user "postgres". > db14=> \dn+ ref_schema|sten_schema > List of schemas > Name |Owner|Access privileges

Re: Changed functionality from 14.3 to 15.3

2023-09-20 Thread Erik Wienhold
leges like I asked to see what's actually granted on both databases: > On Tue, Sep 19, 2023 at 8:17 PM Erik Wienhold wrote: > > > > Have you checked that the permissions are actually the same on both > > databases after running that script? > > > >

Re: Changed functionality from 14.3 to 15.3

2023-09-19 Thread Erik Wienhold
On 2023-09-19 15:09 -0400, Michael Corey wrote: > We are experiencing different functionality once we upgraded from Postgres > 14.3 to Postgres 15.3. > > Below is a test case that we created which shows a schema user who has a > VIEW that accesses a table in another schema. In 14.3 the schema

Re: Granting privileges to a schema to a role

2023-09-11 Thread Erik Wienhold
On 11/09/2023 20:07 CEST Johnson, Bruce E - (bjohnson) wrote: > I’ve created the database ‘webdata', successfully used ora2pg to migrate one > schema ‘trav’ to Postgres. > > The schema on the oracle side is called trav the owner is webdata, and I > created the role trav and granted all table

Re: Huge input lookup exception when trying to create the index for XML data type column in postgreSQL

2023-09-07 Thread Erik Wienhold
On 07/09/2023 21:09 CEST Tom Lane wrote: > Sai Teja writes: > > We have one table which is storing XML data with 30k records and stores > > huge amount of data. > > We are trying to create the index for this column in the table. But, we’re > > getting “Huge input Lookup error” during creation

Re: Only getting few records inserted from millions

2023-09-07 Thread Erik Wienhold
On 07/09/2023 19:14 CEST Anthony Apollis wrote: > The problem is that I am only getting 19 rows inserted into my destination > table. My source has over 5 million rows. What am I doing wrong? Few ideas: * Column dim."IMETA_Entity_Mapping"."Entity_Secondary_Key" allows NULL but the join

Re: listening on an address other than 'localhost'?

2023-09-07 Thread Erik Wienhold
On 06/09/2023 21:23 CEST Johnson, Bruce E - (bjohnson) wrote: > Sep 6 19:06:01 dhbpostgres postgresql@15-main[1538]: 2023-09-06 19:06:01.181 > GMT [1543] LOG: syntax error in file > "/etc/postgresql/15/main/postgresql.conf" line 63, near token ".206" > > #listen_addresses = 10.128.206.109#

Re: Q: inet operators for IPv4 encapsulated in IPv6

2023-09-06 Thread Erik Wienhold
On 06/09/2023 16:51 CEST Albrecht Dreß wrote: > I have a question regarding the use of inet operators in environments with > mixed IPv4 and IPv6 notations. > > Consider the example from sect. 9.12. “Network Address Functions and > Operators” > in the docs which returns properly > > >

Re: postgreSQL UPPER Method is converting the character "µ" into "M"

2023-09-06 Thread Erik Wienhold
On 06/09/2023 18:37 CEST Erik Wienhold wrote: > Homoglyphs are one explanation if you get 'µass' from the generated column as > described. postgres=# SELECT upper('흻횊횜횜'); upper --- 흻횊횜횜 (1 row) The codepoints I picked are: * MATHEMATICA

Re: postgreSQL UPPER Method is converting the character "µ" into "M"

2023-09-06 Thread Erik Wienhold
On 06/09/2023 18:04 CEST Sai Teja wrote: > When I'm trying the below command > Select UPPER('Mass') > I'm getting MASS as output . > But when I created the column with generated always constraint > For example > Alter table xyz add column xyz varchar(800) generated always as > (UPPER(content))

Re: postgreSQL UPPER Method is converting the character "µ" into "M"

2023-09-06 Thread Erik Wienhold
On 06/09/2023 15:42 CEST Sai Teja wrote: > I am using UPPER document name for converting the text from lower case into > upper case. > But here for the below example > Command:- select UPPER(testµ) > Input :- testµ > Output:- TESTM > Expected output :- TESTµ > > Here, that character is

Re: running ANALYZE results in => duplicate key value violates unique constraint "pg_statistic_relid_att_inh_index"

2023-09-06 Thread Erik Wienhold
On 06/09/2023 09:46 CEST Torsten Krah wrote: > I am running that one (official docker image) > > PostgreSQL 13.11 (Debian 13.11-1.pgdg110+1) on x86_64-pc-linux-gnu, > compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit Have you also tried with 13.12? > and one of my nightly jobs reported

Re: ./configure doesn't make effect?

2023-09-05 Thread Erik Wienhold
On 05/09/2023 13:41 CEST jacktby jacktby wrote: > I use “rm -rf /data”, the ‘/data’ is the prefix when I execute ./configure > command firstly, but after I ‘rm’ it, and use the command again, I can’t get > the /data content. Why? ./configure only configures make. You need to run make install

Re: createuser unexpectedly creates superuser with createdb and createrole

2023-09-04 Thread Erik Wienhold
On 04/09/2023 03:42 CEST Tom Lane wrote: > I think the last hunk of this is plenty sufficient, and the earlier > ones just add noise. Done. -- ErikFrom 7728fcab53c8e06c781f7347532cc8619799d8ff Mon Sep 17 00:00:00 2001 From: Erik Wienhold Date: Mon, 4 Sep 2023 23:50:33 +0200 Subject: [PA

Re: rollback to savepoint issue

2023-09-04 Thread Erik Wienhold
On 04/09/2023 16:56 CEST David G. Johnston wrote: > On Monday, September 4, 2023, Erik Wienhold wrote: > > > On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > > > > > The original code in embedded in a function, but the problem is the same: > > > &g

Re: rollback to savepoint issue

2023-09-04 Thread Erik Wienhold
On 04/09/2023 11:51 CEST Lorusso Domenico wrote: > I can't use the savepoint and rollback to savepoint clause. > I've found some similar problems around on the web, but I can't catch the > good way to proceed. > > What I'm trying to do is: > * compare new set of attribute with older > * if

Re: createuser unexpectedly creates superuser with createdb and createrole

2023-09-03 Thread Erik Wienhold
d still read "There is no effective difference between creating users via this utility and via other methods for accessing the server." -- ErikFrom 57309068a0c279f06fe85532e45e2a6813f72d32 Mon Sep 17 00:00:00 2001 From: Erik Wienhold Date: Mon, 4 Sep 2023 02:54:40 +0200 Subject: [PATCH] Docume

Re: Question on Partition key

2023-09-02 Thread Erik Wienhold
On 03/09/2023 00:35 CEST veem v wrote: > We are trying to create a monthly range partition table , partitioned on > column PART_DATE. This will hold Orders and part_date is nothing but invoice > date. Some Team mates are asking to use the "PART_DATE" column as data type > "INTEGER" with "MM" 

Re: pg_dump/pg_restore and the magic of the search_path

2023-08-31 Thread Erik Wienhold
> On 31/08/2023 17:08 CEST Arthur Bazin wrote: > > Consider that we have a function in the public schema witch is named > my_function_in_public. > > In PG11 this table : > CREATE TABLE public.test_dump ( > id TEXT DEFAULT my_function_in_public() > ); > When you dump this table with the pg11

Re: event trigger clarification

2023-08-30 Thread Erik Wienhold
> On 30/08/2023 17:12 CEST Marc Millas wrote: > > the doc v15 states: " pg_event_trigger_ddl_commands returns a list of DDL > commands executed by each user action, when invoked in a function attached > to a ddl_command_end event trigger." > When some ddl command is executed within a block, I

Re: Calculating vm.nr_hugepages

2023-08-30 Thread Erik Wienhold
> On 30/08/2023 15:12 CEST Troels Arvin wrote: > > I assume I need to find the same value as I get from running "postgres > -C shared_memory_size_in_huge_pages". I call that my target value. > Note: I cannot simply run "postgres -C ...", because I need my Ansible > play to work against a server

Re: Restoring default privileges on objects

2023-08-29 Thread Erik Wienhold
> On 29/08/2023 22:44 CEST Stuart McGraw wrote: > > That change would still require someone using \dp to realize that > the "Access privileges" value could be either '' or NULL (I guess > that could be pointed out more obviously in the psql doc), and then > do a '\pset null' before doing \dp?

createuser unexpectedly creates superuser with createdb and createrole

2023-08-29 Thread Erik Wienhold
I recently created a superuser with createuser on 15.4 and was surprised that the superuser also has the CREATEDB and CREATEROLE attribute (although redundant for a superuser). The docs [1] even say that --no-createdb and --no-createrole are the defaults. Those options don't even have an effect

Re: Restoring default privileges on objects

2023-08-29 Thread Erik Wienhold
> On 29/08/2023 21:27 CEST Tom Lane wrote: > > Yeah, perhaps. The reason it so seldom comes up is that a state of > zero privileges is extremely rare (because it's useless in practice). > > That being the case, if we were to do something about this, I'd vote > for changing the display of

Re: Restoring default privileges on objects

2023-08-29 Thread Erik Wienhold
> On 29/08/2023 18:43 CEST Stuart McGraw wrote: > > How does one distinguish between (blank)=(default privileges) > and (blank)=(no privileges)? > > Shouldn't psql put *something* (like "(default)" or "-") in the > "Access privileges" column to indicate that? Or conversely, > something (like

Re: Restoring default privileges on objects

2023-08-29 Thread Erik Wienhold
> On 29/08/2023 03:23 CEST Stuart McGraw wrote: > > If I've done a GRANT or REVOKE on some of the tables, how do I restore > the default privileges so that the “Access privileges” appears empty > again? I re-granted what I think are the default privileges but the > "Access privileges" column for

Re: ora2pg -c ora2pg.conf -t COPY -a tablename not working properly

2023-08-24 Thread Erik Wienhold
> On 24/08/2023 15:49 CEST duc hiep ha wrote: > > Further updated to the below Post. Shortly question: > * Saving data to file using the following Command is fine: > ora2pg -c ora2pg.conf -t COPY -o data.sql schema/data/ > * Direct copy data from Oracle to Postgres doesn't work >

Re: Read only user permission

2023-08-24 Thread Erik Wienhold
> On 24/08/2023 10:11 CEST Dominique Devienne wrote: > > On Wed, Aug 23, 2023 at 7:46 PM Tom Lane wrote: > > > > The readwrite user (not the admin) would need to issue ALTER DEFAULT > > PRIVILEGES granting that. > > Hi. I'm confused Tom. Why should it matter who created the new tables? > > I'm

Re: Read only user permission

2023-08-23 Thread Erik Wienhold
> On 23/08/2023 18:42 CEST Hellen Jiang wrote: > > I have created readonly and readwrite roles with the following grants: > however, readonly user does not have access to the new tables created by > readwrite user. (readonly user has the access to new tables created by admin). > Any idea how I

Re: Failing to compile with ICU support error on Ubuntu

2023-08-19 Thread Erik Wienhold
> On 19/08/2023 14:03 CEST Siddharth Karandikar > wrote: > > Thanks a lot Erik. It worked. > Not sure if the build script gave any specific error about this or I just > missed that... :) No, the output of ./configure only says "not found" without giving the exact reason. The docs have details

Re: Failing to compile with ICU support error on Ubuntu

2023-08-19 Thread Erik Wienhold
> On 19/08/2023 13:26 CEST Siddharth Karandikar > wrote: > > I am trying to build the latest postgresql on my ubuntu docker instance. > But its failing to compile it even when ICU related libraries are installed. > > Compilation fails with > ``` > checking whether to build with ICU support...

Re: AW: AW: Cast INTEGER to BIT confusion

2023-08-17 Thread Erik Wienhold
> On 17/08/2023 15:18 CEST Tom Lane wrote: > > That's probably because the grammar uses SystemTypeName (effectively > prepending "pg_catalog.") for any type that has special syntax called > out in the SQL standard. You could get around that in various ways, > but they all involve changing the

Re: AW: AW: Cast INTEGER to BIT confusion

2023-08-17 Thread Erik Wienhold
at > pg_catalog only is searched immediately if NOT found in the search path. > It seems it is simply impossible to run this application on PostgreSQL, and > we have to stick with a different RDBMS. Very sad. > > -Ursprüngliche Nachricht- > Von: Erik Wienhold > Gesen

Re: Cast INTEGER to BIT confusion

2023-08-17 Thread Erik Wienhold
> On 17/08/2023 14:57 CEST rob stone wrote: > > It works thus:- > > postgres 15.4 =# CREATE TABLE T (c BIT); > CREATE TABLE > postgres 15.4 =# insert into T values (B'1'); > INSERT 0 1 > postgres 15.4 =# select * from t; > c > --- > 1 > (1 row) > > See section 9.6 in the doco. But Markus wrote

Re: Converting sql anywhere to postgres

2023-08-15 Thread Erik Wienhold
> On 15/08/2023 17:04 CEST Russell Rose | Passfield Data Systems > wrote: > > I am trying to convert a SQL Anywhere database to postgres. Within SQL > anywhere a field can have a default value of ‘last user’. This means that > when you perform an update on a table, if the field is not explicitly

Re: AW: Cast INTEGER to BIT confusion

2023-08-15 Thread Erik Wienhold
^ > HINT: You will need to rewrite or cast the expression. > > Apparently the search path is ignored?! > > -Ursprüngliche Nachricht- > Von: Erik Wienhold > Gesendet: Dienstag, 15. August 2023 13:48 > An: [Quipsy] Markus Karg ; pgsql-general@lists.post

Re: AW: Cast INTEGER to BIT confusion

2023-08-15 Thread Erik Wienhold
> On 15/08/2023 13:59 CEST [Quipsy] Markus Karg wrote: > > Is setting the search path something that has to be done for each new > connection / each user, or is this something static and global for the > database? The search path is set per connection and the initial search path can be

Re: Cast INTEGER to BIT confusion

2023-08-15 Thread Erik Wienhold
> On 15/08/2023 10:49 CEST [Quipsy] Markus Karg wrote: > > Hello PostgreSQL Community, > > I like to store just a single bit but that can be either 1 or 0, so I tried > to do this: > > CREATE TABLE T (c BIT); > INSERT INTO T VALUES (1); > -- I MUST NOT change both lines in any way as these are

Re: How to get an md5/sha256 hash of a really large object in psql?

2023-07-29 Thread Erik Wienhold
> On 29/07/2023 08:42 CEST Alex Shan <3341...@gmail.com> wrote: > > In my DB I have a large object over 4GB in size. > I need to get its MD5 or SHA256 from within psql query, i.e. without > exporting it to FS first. > > “SELECT md5(lo_get(loid));” doesnt work — “large object is too large”. > > Is

Re: How to improve the performance of my SQL query?

2023-07-20 Thread Erik Wienhold
> On 20/07/2023 09:09 CEST gzh wrote: > > I'm running into some performance issues with my SQL query. > The following SQL query is taking a long time to execute. > > explain analyze > select COUNT(ET_CD) > from TBL_SHA > WHERE TBL_SHA.MS_CD = '009' > and TBL_SHA.ETRYS in > (select TBL_INF.RY_CD >

Re: Installation Issue

2023-07-17 Thread Erik Wienhold
> On 17/07/2023 16:30 CEST Adrian Klaver wrote: > > > The other screenshot is a pgAdmin issue. I have seen quite a few > questions about this on Stack Overflow recently. Seems to be related to > version 7.4. My suggestion would be to file an issue here: > >

Re: Problem perhaps after upgrading to pgadmin4 7.4

2023-07-13 Thread Erik Wienhold
> On 13/07/2023 13:20 CEST Carl Erik Eriksson wrote: > > Query tool PGadmin on my mac > > If I enter a query like select count(*) from table_1I get a correct > response from the server > If I enter select * from table_1 I get an error message that I do not > understand: > Error

Re: INSERT UNIQUE row?

2023-07-10 Thread Erik Wienhold
> On 10/07/2023 04:25 CEST p...@pfortin.com wrote: > > On Sun, 9 Jul 2023 17:04:03 -0700 Adrian Klaver wrote: > > >On 7/9/23 15:58, p...@pfortin.com wrote: > >> Hi, > >> > >> Trying to figure out how to insert new property addresses into an > >> existing table. > >> > >> Can a UNIQUE constraint be

Re: function to_char(unknown) is not unique at character 8

2023-07-06 Thread Erik Wienhold
> On 06/07/2023 11:19 CEST gzh wrote: > > I upgraded the version of PostgreSQL from 12.6 to 12.13, > when I execute the sql below , the to_char function caused the following > error. > > ---SQL-- > select TO_CHAR('100'); > > ERROR: function to_char(unknown) is not

Re: Strange behaviour on function

2023-07-05 Thread Erik Wienhold
> On 05/07/2023 17:16 CEST Adrian Klaver wrote: > > https://www.postgresql.org/docs/current/plpgsql-trigger.html > > 1) > "A trigger function must return either NULL or a record/row value having > exactly the structure of the table the trigger was fired for." > > 2) I am not seeing where you use:

Re: Strange behaviour on function

2023-07-05 Thread Erik Wienhold
> On 05/07/2023 14:23 CEST Lorusso Domenico wrote: > > Hello guys, > here a simple function > > CREATE OR REPLACE FUNCTION bind_action( > sqlstr text, > hrec hstore) > RETURNS text > LANGUAGE 'plpgsql' > COST 100 > immutable PARALLEL SAFE > AS $BODY$ > declare > _sqlstr text=sqlstr; > _k

Re: psql -c command parse "select $$hello$$" failed

2023-07-04 Thread Erik Wienhold
> On 04/07/2023 14:21 CEST jian he wrote: > > not sure this is the expected result. > > /home/jian/postgres/pg16_test/bin/psql -d test_dev -p 5455 -c "select > $$hello$$" > 2023-07-04 20:15:51.066 CST [1562050] ERROR: trailing junk after > numeric literal at or near "884070h" at character 8 >

Re: [Beginner Question] How to print the call link graph?

2023-07-01 Thread Erik Wienhold
> On 01/07/2023 09:10 CEST Wen Yi wrote: > > I use the gdb to track the postgres like this: > > ... > pq_getbyte () at pqcomm.c:980 > 980 in pqcomm.c > (gdb) next > 985 in pqcomm.c > (gdb) next > 986 in pqcomm.c > (gdb) next > SocketBackend (inBuf=0x7ffc8f7e1310) at postgres.c:372 > > 372

Re: pg_service file questions

2023-06-20 Thread Erik Wienhold
> On 20/06/2023 08:11 CEST JUN ZHI wrote: > > I was scanning through the postgresql documentations when i came across this > webpage:PostgreSQL: Documentation: 15: 34.17. The Connection Service File > (https://www.postgresql.org/docs/current/libpq-pgservice.html). I am fairly > new to database

Re: How To: A large [2D] matrix, 100,000+ rows/columns

2023-06-09 Thread Erik Wienhold
> On 09/06/2023 16:00 CEST Wim Bertels wrote: > > Joe Conway schreef op vr 09-06-2023 om 09:16 [-0400]: > > On 6/8/23 22:17, Pat Trainor wrote: > > > I need to have a very large matrix to maintain & query, and if not > > > (1,600 column limit), then how could such data be broken down to > > >

Re: How to store query result into another table using stored procedure

2023-06-09 Thread Erik Wienhold
> On 09/06/2023 07:51 CEST Rama Krishnan wrote: > > CREATE or REPLACE PROCEDURE deleted_cards_count_test(start_date TIMESTAMP, > end_date TIMESTAMP) AS $$ > DECLARE > current_date TIMESTAMP; > month_start_date TIMESTAMP; > month_end_date TIMESTAMP; > month24_end_date TIMESTAMP; >

Re: How to securely isolate databases/users in a multi-tenant Postgresql?

2023-06-09 Thread Erik Wienhold
> On 09/06/2023 08:54 CEST Alex Lee wrote: > > I want to make a service that gives each of my users their own PG user and > database. I want to keep them isolated from each other. There are no special > extensions installed, it's a pretty vanilla PG cluster. > > Are there any considerations

Re: Drivers users by connections

2023-06-06 Thread Erik Wienhold
> On 06/06/2023 09:18 CEST Hrishikesh (Richie) Rode wrote: > > We are not able to find table which give session connection details about > drivers. In pg_stat_activity details information is not there. Please let us > know where we can find these information. Column

Re: How to remove user specific grant and revoke

2023-06-03 Thread Erik Wienhold
> On 04/06/2023 00:08 CEST Andrus wrote: > > > Should I ran separate revoke commands for every user to remove those > > revokes ? > > How to remove user-spefic grants ? > After running revoke commands in psql, GRANT commands disappeared magically. > It looks like pgAdmin does not allow execute

Re: How to remove user specific grant and revoke

2023-06-03 Thread Erik Wienhold
> On 03/06/2023 23:34 CEST Andrus wrote: > > psql (12.2 (Debian 12.2-2.pgdg100+1)) > Type "help" for help. > > sba=# REVOKE ALL ON public.kaspriv FROM alekspoluh; > REVOKE > sba=# \o result.txt > sba=# \dp public.kaspriv > > sba=# \q > #grep alekspoluh result.txt > Returns nothing. So output

Re: How to remove user specific grant and revoke

2023-06-03 Thread Erik Wienhold
> On 03/06/2023 22:33 CEST Andrus wrote: > > I tried > alter role alekspoluh reset all This only resets role-specific settings, not privileges. > After this command pgAdmin still shows revoke and grant commands for > alekspoluh role. > How to remove all grant and revoke assignments for role ?

Re: How to remove user specific grant and revoke

2023-06-03 Thread Erik Wienhold
> On 03/06/2023 18:14 CEST Andrus wrote: > > > Or just execute those REVOKE ALL commands (except for PUBLIC) that pgAdmin > > already gives you. > pgAdmin gives > REVOKE ALL ON TABLE public.kaspriv FROM someuser; > I ran it but pgAdmin still gives this statement. What are the current table

Re: How to remove user specific grant and revoke

2023-06-03 Thread Erik Wienhold
> On 03/06/2023 14:46 CEST Erik Wienhold wrote: > > > On 03/06/2023 09:16 CEST Andrus wrote: > > > > DROP REVOKE ALL ON TABLE public.kaspriv FROM all EXCEPT public; > > DROP GRANT SELECT ON TABLE public.kaspriv FROM all EXCEPT public; > > > > This will b

Re: How to remove user specific grant and revoke

2023-06-03 Thread Erik Wienhold
> On 03/06/2023 09:16 CEST Andrus wrote: > > User groups table is defined as > > CREATE TABLE IF NOT EXISTS public.kaspriv > ( > id serial primary key, > user character(10) NOT NULL, > group character(35) NOT NULL > ... > ) > > There are hundreds of users. Earlier time grant and revoke commands

Re: event trigger should provide more details

2023-05-30 Thread Erik Wienhold
> On 31/05/2023 00:28 CEST Lian Jiang wrote: > > The info useful for me is command_tag, object_type, object_identity. > classid, objid is not useful since object_identity is more explicit. > objsubid is not useful because I don't need comment >

Re: event trigger should provide more details

2023-05-30 Thread Erik Wienhold
> On 30/05/2023 22:23 CEST Lian Jiang wrote: > > I plan to create an event trigger to detect schema change (e.g. add/remove > a column, change column type), and write it into a separate table (e.g. > EVENTS). Then a process periodically reads this table to send schema change > notification.

Re: CREATE TEMPORARY TABLE LIKE

2023-05-25 Thread Erik Wienhold
> On 25/05/2023 15:06 CEST Jim Vanns wrote: > > When basing a temporary table of a source table, are triggers included > by default? I have this statement; > > CREATE TEMPORARY TABLE dev_main ( > LIKE prod_main > INCLUDING ALL > EXCLUDING INDEXES > EXCLUDING CONSTRAINTS > ) ON COMMIT DELETE ROWS;

  1   2   >