RE: (When) can a single SQL statement return multiple result sets?

2024-04-11 Thread Patrick FICHE
-Original Message- From: Jan Behrens Sent: Wednesday, April 10, 2024 11:23 PM To: pgsql-general@lists.postgresql.org Subject: (When) can a single SQL statement return multiple result sets? Hello, While writing a PostgreSQL client library for Lua supporting Pipelining (using

RE: array_to_json/array_agg question

2024-02-20 Thread Patrick FICHE
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

RE: ALTER SUBSCRIPTION ... REFRESH cannot be executed from a function

2023-12-06 Thread Patrick FICHE
Hi Roman, We had the same problem and we had to create a SERVER (loopback) and use dblink in order to get in done within a Stored Procedure. I don’t know if this solution will work in your case but it could be something like this…. CREATE SERVER loopback_dblink FOREIGN DATA WRAPPER

RE: PITR and Temp Tables

2022-04-20 Thread Patrick FICHE
From: Huan Ruan Sent: Wednesday, April 20, 2022 2:18 PM To: pgsql-general@lists.postgresql.org Subject: PITR and Temp Tables Hi All Let's say at T0 a database has N session based temp tables. They would have corresponding records in the catalog tables like pg_class and pg_attribute that are

RE: Wildcarding json keys in json query

2021-11-30 Thread Patrick FICHE
I guess you could try something like this SELECT * FROM ( SELECT * from json_each(( '{ "ports" : { "port_abc":{"min": 5, "max": 7, "mean": 6},

RE: Replace anonymized data in string

2021-11-12 Thread Patrick FICHE
> On 12 Nov 2021, at 15:12, Patrick FICHE wrote: > Is there any way to do this ? There was a presentation on the subject of anonymization and data masking at Fosdem PGDay 2019, maybe the slides from there can give any insights? https://www.postgresql.eu/events/fosdem2019/schedule/sessio

Replace anonymized data in string

2021-11-12 Thread Patrick FICHE
Hi Team, I have some data that has been anonymized and I would like to generate some test data from this. In some way, I would like to deanonymize this data with random data. For example, phone numbers have been anonymized with changing the 5 right digits with the 8 digit (preserving length).

RE: PostGreSQL TDE encryption patch

2020-06-25 Thread Patrick FICHE
. A dump and reload to an encrypted instance is required, or logical replication can be used to perform the migration online. Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 [01-03_AQSA_Main_Corporate_Logo_JPEG_White_Low.jpg]<http://www.aqsacom.com/> From: Bha

Re: SET ROLE and search_path

2020-05-20 Thread Patrick FICHE
Thanks a lot I will try it again. I probably missed something in my configuration. Téléchargez Outlook pour iOS<https://aka.ms/o0ukef> De : Adam Brusselback Envoyé : Wednesday, May 20, 2020 9:28:21 PM À : Patrick FICHE Cc : pgsql-general@lists.postgres

SET ROLE and search_path

2020-05-20 Thread Patrick FICHE
Hi, I'm trying to implement a PostgreSQL multi-tenant database that will be accessed by a Web Application. The users that will login will belong to different companies and a schema was created in the database for each company. However, I would like the Web Application to connect with a single

RE: How can I set a timeout for a locked table in Function ?

2020-01-03 Thread Patrick FICHE
://dba.stackexchange.com/questions/82977/why-set-local-statement-timeout-does-not-work-as-expected-with-postgresql-func Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 [01-03_AQSA_Main_Corporate_Logo_JPEG_White_Low.jpg]<http://www.aqsacom.com/> From: İlyas Derse Sent: Friday, Jan

RE: How to reset a server error '25P02 in_failed_sql_transaction'

2019-12-31 Thread Patrick FICHE
is OFF but you can set it to ON and it should solve your issue as only explicit transactions will keep a transaction context. Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 -Original Message- From: Matthias Apitz Sent: Tuesday, December 31, 2019 6:55 AM

RE: Identity columns, DEFAULT keyword and multi-row inserts

2019-12-09 Thread Patrick FICHE
identity as "generated by default". Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 -Original Message- From: Thomas Kellerer Sent: Tuesday, December 10, 2019 8:42 AM To: pgsql-general@lists.postgresql.org Subject: Identity columns, DEFAULT keyword and

RE: Syntax error for UPDATE ... RETURNING INTO STRICT

2019-12-03 Thread Patrick FICHE
) RETURNS boolean AS $func$ UPDATE words_moves SET puzzle = NOT puzzle WHERE mid = in_mid RETURNING puzzle; $func$ LANGUAGE sql; Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 [01-03_AQSA_Main_Corporate_Logo_JPEG_White_Low.jpg]<h

RE: Execute a function through fdw

2019-10-18 Thread Patrick FICHE
Le ven. 18 oct. 2019 à 17:53, Patrick FICHE mailto:patrick.fi...@aqsacom.com>> a écrit : Hi, I got one more issue after I created my view. I created it on my Server 1 but I am unable to view it on the Server 2. I can see all tables through fdw after IMPORT FOREIGN SCHEMA. I was able

RE: Execute a function through fdw

2019-10-18 Thread Patrick FICHE
. Is it the expected behavior to recreate the FOREIGN SERVER / SCHEMA after a new table or view has been created ? Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 -Original Message- From: Patrick FICHE Sent: Friday, October 18, 2019 2:35 PM To: Tom Lane ; Guillaume

RE: Execute a function through fdw

2019-10-18 Thread Patrick FICHE
Thanks a lot for your answer. Using a view is really a good solution for my case. As I already use fdw for some other cases, I prefer not to mix with dblink. Regards, Patrick Fiche -Original Message- From: Tom Lane Sent: Friday, October 18, 2019 1:55 PM To: Guillaume Lelarge Cc

Execute a function through fdw

2019-10-18 Thread Patrick FICHE
rmt_schema.Get_Tables(); Or is it required to create a local function that will access to remote tables in order to achieve the same result ? Regards, Patrick Fiche e. patrick.fi...@aqsacom.com<mailto:patrick.fi...@aqsacom.com> [cid:image001.png@01D585AA.51A4D870]<http://www.aqsacom.com/>

RE: Primary Key Update issue ?

2019-09-06 Thread Patrick FICHE
immediately, not at end of statement as the standard would suggest. Regards, Patrick Fiche From: Andreas Joseph Krogh Sent: Friday, September 6, 2019 11:17 AM To: pgsql-general@lists.postgresql.org Subject: Sv: Primary Key Update issue ? På fredag 06. september 2019 kl. 11:06:04, skrev Patrick

Primary Key Update issue ?

2019-09-06 Thread Patrick FICHE
Hello, While doing some testing on a Postgresql database, I encountered a strange behavior which is very simple to reproduce. I just wanted to know if this is expected behavior or if it should be considered as an issue. The scenario to reproduce it is the following. CREATE TABLE Test ( pKey

RE: Which records aren't in list? Use static list as table or records

2019-05-22 Thread Patrick FICHE
Hi, May be something like this could help SELECT TestList.id FROM ( SELECT * FROM ( VALUES( 1 ), (5), (12), (33), (55) ) t ) AS TestList( id ) LEFT OUTER JOIN idList ON IdList.id = TEstList.id WHERE IdList.Id IS NULL; Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 [01

RE: dbuser acess privileges

2019-04-04 Thread Patrick FICHE
he use of the nextval and setval functions. For large objects, this privilege allows writing or truncating the object. Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 [01-03_AQSA_Main_Corporate_Logo_JPEG_White_Low.jpg]<http://www.aqsacom.com/> From: Ron Se

RE: dbuser acess privileges

2019-04-04 Thread Patrick FICHE
Hi, If I’m not wrong, UPDATE requires SELECT permission as the UPDATE statement needs to read the data to be updated. So, you should probably add GRANT SELECT and you get it work. Regards, Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 [01

Function for Exception Logging

2018-10-29 Thread Patrick FICHE
/ parameters to log the exception parameters into a table. Is there any way to manage this without providing the Exception parameters as parameters to the Log_Error function ? Thanks, Patrick Patrick Fiche Database Engineer, Aqsacom Sas. c. 33 6 82 80 69 96 e. patrick.fi...@aqsacom.com

Function for Exception Logging

2018-10-29 Thread Patrick FICHE
Hi community, I would like to implement a function that would log managed Exceptions into a dedicated table. For example, I have some code like : BEGIN Code generation exception EXCEPTION WHEN OTHERS THEN Log_Error(); END; The Log_Error function would be able to get the exception context /