Partitioned table with fillfactor

2022-08-01 Thread endre_pekarik
Hello,

 

'PostgreSQL 11.13 on x86_64-pc-linux-gnu, compiled by
x86_64-pc-linux-gnu-gcc (GCC) 7.4.0, 64-bit'

 

 

I created a partitioned table. I didn't load any data into it. 

 

When I try to ALTER TABLE tablename SET (fillfactor = 80); , I get an
Unrecognized parameter "fillfactor" message.  Is it because I can't use
fillfactor with the partitioned table? 

 

Thank you

Endre



Re: Upgradede Pgadmin4 to v6.12 - new startup error

2022-08-01 Thread Dave Page
Hi

On Mon, 1 Aug 2022 at 16:46, Cherio  wrote:

> Thanks Dave! The application started after I added the line you suggested
> . Although in my opinion, trying to work around a new feature in order
> to start pgadmin feels wrong.
>


I agree. The difficulty is though that we either fail early, or fail later
which would likely affect fewer users, but would be much harder to detect
reliably as it’s an external process that would fail(in this case,
azure-cli I believe).

>
> I have 2 follow-up questions.
>
> 1. Presently I have to redefine paths for several files and directories
> (see below). Is there a better way/place to define DATA_DIR so that
> subdirectories and files in it need not be explicitly redefined? It just
> doesn't feel like a good design pattern :)
>
> LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
> SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
> SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
> STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
> AZURE_CREDENTIAL_CACHE_DIR = os.path.join(DATA_DIR, 'azurecredentialcache')
>

Yeah, it’s a chicken and egg problem, and it has mildly annoyed me in the
past too. I’ll give it some more thought.

>
>
> 2. I am guessing the new "azurecredentialcache" directory is related to
> the new feature that adds "support for Azure PostgreSQL deployment in
> server mode". Why is it trying to create new directories in an environment
> that has nothing to do with Azure?
>

It has no way to know that you’re not going to use that feature - for all
we or it knows, your boss might ask you to evaluate PostgreSQL on Azure
next week :-)

>
>
>
> On Mon, Aug 1, 2022 at 11:10 AM Dave Page  wrote:
>
>> Hi
>>
>> On Mon, 1 Aug 2022 at 16:01, Cherio  wrote:
>>
>>> I grepped the sources for 'azurecredentialcache':
>>>
>>> user@HOST:~/opt/pgadmin4$ grep -R azurecredentialcache .
>>> ./lib/python3.8/site-packages/pgadmin4/config.py:AZURE_CREDENTIAL_CACHE_DIR
>>> = os.path.join(DATA_DIR, 'azurecredentialcache')
>>>
>>> I do re-define DATA_DIR in my configuration file (see below) so it is
>>> unclear why it is trying to create something in "/var/lib/pgadmin":
>>>
>>
>> Almost certainly because config_local.py is read at the end of config.py,
>> so the change you make to DATA_DIR isn't reflected by
>> AZURE_CREDENTIAL_CACHE_DIR.
>>
>>
>>>
>>> user@HOST:~/opt/pgadmin4$ cat
>>> ./lib/python3.8/site-packages/pgadmin4/config_local.py
>>> import os
>>> DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.config/pgadmin-v4/'))
>>> LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
>>> SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
>>> SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
>>> STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
>>> PGADMIN_INT_PORT=
>>> DEFAULT_SERVER_PORT=
>>> SERVER_MODE = False
>>> MASTER_PASSWORD_REQUIRED = False
>>>
>>
>> Try adding the following to config_local.py:
>>
>> AZURE_CREDENTIAL_CACHE_DIR = os.path.join(DATA_DIR,
>> 'azurecredentialcache')
>>
>> That will ensure it gets reset after you redefine DATA_DIR.
>>
>> I think we have some docs/comments about re-defining things if you change
>> DATA_DIR; I'll go check they mention AZURE_CREDENTIAL_CACHE_DIR as well.
>>
>>
>>>
>>> I skipped version 6.11 and upgraded from 6.10 so I can't say whether
>>> this broke in 6.11 or 6.12.
>>>
>>> On Mon, Aug 1, 2022 at 10:09 AM Cherio  wrote:
>>>
 This was just a regular upgrade (I went through dozens of these).
 The new 6.12 version fails to start with the following error message:

   File "lib/python3.8/site-packages/pgadmin4/pgAdmin4.py", line 93, in
 
 app = create_app()
   File
 "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/__init__.py",
 line 270, in create_app
 create_app_data_directory(config)
   File
 "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
 line 117, in create_app_data_directory
 _create_directory_if_not_exists(config.AZURE_CREDENTIAL_CACHE_DIR)
   File
 "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
 line 20, in _create_directory_if_not_exists
 os.mkdir(_path)
 FileNotFoundError: [Errno 2] No such file or directory:
 '/var/lib/pgadmin/azurecredentialcache'

 My setup has absolutely nothing to do with Azure. I use python wheel
 having PgAdmin installed in an unprivileged environment, so I am puzzled
 why it is all of sudden trying to look for something in "/var/lib/pgadmin"
 or create things there?


>>
>> --
>> Dave Page
>> Blog: https://pgsnake.blogspot.com
>> Twitter: @pgsnake
>>
>> EDB: https://www.enterprisedb.com
>>
>> --
-- 
Dave Page
https://pgsnake.blogspot.com

EDB Postgres
https://www.enterprisedb.com


Re: Upgradede Pgadmin4 to v6.12 - new startup error

2022-08-01 Thread Cherio
Thanks Dave! The application started after I added the line you suggested
. Although in my opinion, trying to work around a new feature in order
to start pgadmin feels wrong.

I have 2 follow-up questions.

1. Presently I have to redefine paths for several files and directories
(see below). Is there a better way/place to define DATA_DIR so that
subdirectories and files in it need not be explicitly redefined? It just
doesn't feel like a good design pattern :)

LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
AZURE_CREDENTIAL_CACHE_DIR = os.path.join(DATA_DIR, 'azurecredentialcache')

2. I am guessing the new "azurecredentialcache" directory is related to the
new feature that adds "support for Azure PostgreSQL deployment in server
mode". Why is it trying to create new directories in an environment that
has nothing to do with Azure?


On Mon, Aug 1, 2022 at 11:10 AM Dave Page  wrote:

> Hi
>
> On Mon, 1 Aug 2022 at 16:01, Cherio  wrote:
>
>> I grepped the sources for 'azurecredentialcache':
>>
>> user@HOST:~/opt/pgadmin4$ grep -R azurecredentialcache .
>> ./lib/python3.8/site-packages/pgadmin4/config.py:AZURE_CREDENTIAL_CACHE_DIR
>> = os.path.join(DATA_DIR, 'azurecredentialcache')
>>
>> I do re-define DATA_DIR in my configuration file (see below) so it is
>> unclear why it is trying to create something in "/var/lib/pgadmin":
>>
>
> Almost certainly because config_local.py is read at the end of config.py,
> so the change you make to DATA_DIR isn't reflected by
> AZURE_CREDENTIAL_CACHE_DIR.
>
>
>>
>> user@HOST:~/opt/pgadmin4$ cat
>> ./lib/python3.8/site-packages/pgadmin4/config_local.py
>> import os
>> DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.config/pgadmin-v4/'))
>> LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
>> SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
>> SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
>> STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
>> PGADMIN_INT_PORT=
>> DEFAULT_SERVER_PORT=
>> SERVER_MODE = False
>> MASTER_PASSWORD_REQUIRED = False
>>
>
> Try adding the following to config_local.py:
>
> AZURE_CREDENTIAL_CACHE_DIR = os.path.join(DATA_DIR, 'azurecredentialcache')
>
> That will ensure it gets reset after you redefine DATA_DIR.
>
> I think we have some docs/comments about re-defining things if you change
> DATA_DIR; I'll go check they mention AZURE_CREDENTIAL_CACHE_DIR as well.
>
>
>>
>> I skipped version 6.11 and upgraded from 6.10 so I can't say whether this
>> broke in 6.11 or 6.12.
>>
>> On Mon, Aug 1, 2022 at 10:09 AM Cherio  wrote:
>>
>>> This was just a regular upgrade (I went through dozens of these).
>>> The new 6.12 version fails to start with the following error message:
>>>
>>>   File "lib/python3.8/site-packages/pgadmin4/pgAdmin4.py", line 93, in
>>> 
>>> app = create_app()
>>>   File
>>> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/__init__.py",
>>> line 270, in create_app
>>> create_app_data_directory(config)
>>>   File
>>> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
>>> line 117, in create_app_data_directory
>>> _create_directory_if_not_exists(config.AZURE_CREDENTIAL_CACHE_DIR)
>>>   File
>>> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
>>> line 20, in _create_directory_if_not_exists
>>> os.mkdir(_path)
>>> FileNotFoundError: [Errno 2] No such file or directory:
>>> '/var/lib/pgadmin/azurecredentialcache'
>>>
>>> My setup has absolutely nothing to do with Azure. I use python wheel
>>> having PgAdmin installed in an unprivileged environment, so I am puzzled
>>> why it is all of sudden trying to look for something in "/var/lib/pgadmin"
>>> or create things there?
>>>
>>>
>
> --
> Dave Page
> Blog: https://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EDB: https://www.enterprisedb.com
>
>


Re: Upgradede Pgadmin4 to v6.12 - new startup error

2022-08-01 Thread Dave Page
Hi

On Mon, 1 Aug 2022 at 16:01, Cherio  wrote:

> I grepped the sources for 'azurecredentialcache':
>
> user@HOST:~/opt/pgadmin4$ grep -R azurecredentialcache .
> ./lib/python3.8/site-packages/pgadmin4/config.py:AZURE_CREDENTIAL_CACHE_DIR
> = os.path.join(DATA_DIR, 'azurecredentialcache')
>
> I do re-define DATA_DIR in my configuration file (see below) so it is
> unclear why it is trying to create something in "/var/lib/pgadmin":
>

Almost certainly because config_local.py is read at the end of config.py,
so the change you make to DATA_DIR isn't reflected by
AZURE_CREDENTIAL_CACHE_DIR.


>
> user@HOST:~/opt/pgadmin4$ cat
> ./lib/python3.8/site-packages/pgadmin4/config_local.py
> import os
> DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.config/pgadmin-v4/'))
> LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
> SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
> SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
> STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
> PGADMIN_INT_PORT=
> DEFAULT_SERVER_PORT=
> SERVER_MODE = False
> MASTER_PASSWORD_REQUIRED = False
>

Try adding the following to config_local.py:

AZURE_CREDENTIAL_CACHE_DIR = os.path.join(DATA_DIR, 'azurecredentialcache')

That will ensure it gets reset after you redefine DATA_DIR.

I think we have some docs/comments about re-defining things if you change
DATA_DIR; I'll go check they mention AZURE_CREDENTIAL_CACHE_DIR as well.


>
> I skipped version 6.11 and upgraded from 6.10 so I can't say whether this
> broke in 6.11 or 6.12.
>
> On Mon, Aug 1, 2022 at 10:09 AM Cherio  wrote:
>
>> This was just a regular upgrade (I went through dozens of these).
>> The new 6.12 version fails to start with the following error message:
>>
>>   File "lib/python3.8/site-packages/pgadmin4/pgAdmin4.py", line 93, in
>> 
>> app = create_app()
>>   File
>> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/__init__.py",
>> line 270, in create_app
>> create_app_data_directory(config)
>>   File
>> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
>> line 117, in create_app_data_directory
>> _create_directory_if_not_exists(config.AZURE_CREDENTIAL_CACHE_DIR)
>>   File
>> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
>> line 20, in _create_directory_if_not_exists
>> os.mkdir(_path)
>> FileNotFoundError: [Errno 2] No such file or directory:
>> '/var/lib/pgadmin/azurecredentialcache'
>>
>> My setup has absolutely nothing to do with Azure. I use python wheel
>> having PgAdmin installed in an unprivileged environment, so I am puzzled
>> why it is all of sudden trying to look for something in "/var/lib/pgadmin"
>> or create things there?
>>
>>

-- 
Dave Page
Blog: https://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: https://www.enterprisedb.com


Re: Upgradede Pgadmin4 to v6.12 - new startup error

2022-08-01 Thread Cherio
I grepped the sources for 'azurecredentialcache':

user@HOST:~/opt/pgadmin4$ grep -R azurecredentialcache .
./lib/python3.8/site-packages/pgadmin4/config.py:AZURE_CREDENTIAL_CACHE_DIR
= os.path.join(DATA_DIR, 'azurecredentialcache')

I do re-define DATA_DIR in my configuration file (see below) so it is
unclear why it is trying to create something in "/var/lib/pgadmin":

user@HOST:~/opt/pgadmin4$ cat
./lib/python3.8/site-packages/pgadmin4/config_local.py
import os
DATA_DIR = os.path.realpath(os.path.expanduser(u'~/.config/pgadmin-v4/'))
LOG_FILE = os.path.join(DATA_DIR, 'pgadmin4.log')
SQLITE_PATH = os.path.join(DATA_DIR, 'pgadmin4.db')
SESSION_DB_PATH = os.path.join(DATA_DIR, 'sessions')
STORAGE_DIR = os.path.join(DATA_DIR, 'storage')
PGADMIN_INT_PORT=
DEFAULT_SERVER_PORT=
SERVER_MODE = False
MASTER_PASSWORD_REQUIRED = False

I skipped version 6.11 and upgraded from 6.10 so I can't say whether this
broke in 6.11 or 6.12.

On Mon, Aug 1, 2022 at 10:09 AM Cherio  wrote:

> This was just a regular upgrade (I went through dozens of these).
> The new 6.12 version fails to start with the following error message:
>
>   File "lib/python3.8/site-packages/pgadmin4/pgAdmin4.py", line 93, in
> 
> app = create_app()
>   File
> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/__init__.py",
> line 270, in create_app
> create_app_data_directory(config)
>   File
> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
> line 117, in create_app_data_directory
> _create_directory_if_not_exists(config.AZURE_CREDENTIAL_CACHE_DIR)
>   File
> "/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
> line 20, in _create_directory_if_not_exists
> os.mkdir(_path)
> FileNotFoundError: [Errno 2] No such file or directory:
> '/var/lib/pgadmin/azurecredentialcache'
>
> My setup has absolutely nothing to do with Azure. I use python wheel
> having PgAdmin installed in an unprivileged environment, so I am puzzled
> why it is all of sudden trying to look for something in "/var/lib/pgadmin"
> or create things there?
>
>


Upgradede Pgadmin4 to v6.12 - new startup error

2022-08-01 Thread Cherio
This was just a regular upgrade (I went through dozens of these).
The new 6.12 version fails to start with the following error message:

  File "lib/python3.8/site-packages/pgadmin4/pgAdmin4.py", line 93, in

app = create_app()
  File
"/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/__init__.py",
line 270, in create_app
create_app_data_directory(config)
  File
"/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
line 117, in create_app_data_directory
_create_directory_if_not_exists(config.AZURE_CREDENTIAL_CACHE_DIR)
  File
"/path-to/opt/pgadmin4/lib/python3.8/site-packages/pgadmin4/pgadmin/setup/data_directory.py",
line 20, in _create_directory_if_not_exists
os.mkdir(_path)
FileNotFoundError: [Errno 2] No such file or directory:
'/var/lib/pgadmin/azurecredentialcache'

My setup has absolutely nothing to do with Azure. I use python wheel having
PgAdmin installed in an unprivileged environment, so I am puzzled why it is
all of sudden trying to look for something in "/var/lib/pgadmin" or create
things there?


Re: Bug Report: pgAdmin 6.12 doesn't show contents of information_schema and pg_catalog

2022-08-01 Thread Akshay Joshi
Hi Nicolas

Can you please log the issue
https://redmine.postgresql.org/projects/pgadmin4/issues/new

On Mon, Aug 1, 2022 at 5:42 PM Nicolas Dechamps  wrote:

> Hello!
>
>
>
> I noticed that with pgAdmin 6.12, the contents of information_schema and
> pg_catalog in the Browser cannot be displayed. Clicking on the arrows to
> unfold these schemas, flips the arrow downwards, but yields no results. I
> downgraded to 6.11 and it still works with that version.
>
>
>
> Kind regards,
>
> Nicolas Dechamps
>
>
>
>
> --
>
>
> Nicolas Dechamps
>
> IT Service
> decha...@intend.de
>
>
> INTEND Geoinformatik GmbH
> Johanna-Waescher-Straße 5
> D - 34131 Kassel
>
> Tel +49 (0561) 316 799 0
> Fax +49 (0561) 316 799 7
> Web http://www.intend.de
>
> INTEND Geoinformatik GmbH
> Amtsgericht Kassel
> HRB 7336
> Geschäftsführer Michael Zintel
> UstID-Nr.: DE206491704
> St.-Nr.: 025 236 30022
>


-- 



Akshay Joshi

Principal Software Architect

+91 9767888246

www.enterprisedb.com







Bug Report: pgAdmin 6.12 doesn't show contents of information_schema and pg_catalog

2022-08-01 Thread Nicolas Dechamps
Hello!

I noticed that with pgAdmin 6.12, the contents of information_schema and 
pg_catalog in the Browser cannot be displayed. Clicking on the arrows to unfold 
these schemas, flips the arrow downwards, but yields no results. I downgraded 
to 6.11 and it still works with that version.

Kind regards,
Nicolas Dechamps




Nicolas Dechamps

IT Service
decha...@intend.de


INTEND Geoinformatik GmbH
Johanna-Waescher-Stra?e 5
D - 34131 Kassel

Tel +49 (0561) 316 799 0
Fax +49 (0561) 316 799 7
Web http://www.intend.de

INTEND Geoinformatik GmbH
Amtsgericht Kassel
HRB 7336
Gesch?ftsf?hrer Michael Zintel
UstID-Nr.: DE206491704
St.-Nr.: 025 236 30022


auto-connect to database with docker-deployment of pgadmin

2022-08-01 Thread Daniel Kaupp
Hi all,

I'm working on a setup in MS Azure with Terraform. Postgresql is already in
place and pgadmin is deployed via Docker image from dpage. I was wondering
if there is a automatic way to tell pgadmin to which DB-Server it should
connect to, at deploy time (or short after)? This way, i could use the db
credentials stored in Azure keyvault without exposing them to any user.

Thanks,
Daniel