Re: PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread Pavel Stehule
> > > > It now seems to me to be odd, in the light of the explanations for why the > naïve (PL/SQL-style) syntax doesn't work in PL/pgSQL, that assigning a > scalar subquery to a variable of the composite type in question _does_ > work! But don't take that as a question. I'm going to regard this as

Re: PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread Pavel Stehule
po 9. 8. 2021 v 23:13 odesílatel Tom Lane napsal: > Pavel Stehule writes: > > Some errors like this, but not this can be detected by plpgsql_check > > https://github.com/okbob/plpgsql_check - probably the heuristic for type > > check is not complete. > > STRICTMULTIASSIGNMENT would detect most c

Re: Serious List of PostgreSQL usage questions.

2021-08-09 Thread Mladen Gogala
Responses in-line: On 8/9/21 10:01 PM, A Z wrote: 1) Are there free scripts for CREATE TYPE (native type), more advanced, or sorts of types out there, online, free for commercial use? With function support, too? Can someone reply with a link or a suggestion? ORAFCE? That extension has Or

Re: Serious List of PostgreSQL usage questions.

2021-08-09 Thread David G. Johnston
As this is your third email of this form, with mostly the same questions, I would suggestion you send a single email, with an appropriate subject line, per question to facilitate discussion and avoid subjecting people to looking at multiple bulk threads to see what has and hasn't been said. Then,

Serious List of PostgreSQL usage questions.

2021-08-09 Thread A Z
1) Are there free scripts for CREATE TYPE (native type), more advanced, or sorts of types out there, online, free for commercial use? With function support, too? Can someone reply with a link or a suggestion? 2) How may I get PostgreSQL to output the create table statement(s) for one or more

Re: archive_command / single user mode

2021-08-09 Thread David G. Johnston
On Mon, Aug 9, 2021 at 4:17 PM Christophe Pettus wrote: > Does archive_command run in single user mode? This isn't an actual > situation at the moment, but for runbook / disaster planning purposes, I > was curious. > > Nope. If I follow the source code correctly...main.c calls PostgresMain (pos

Re: PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread Bryn Llewellyn
> t...@sss.pgh.pa.us wrote: > >> pavel.steh...@gmail.com writes: >> >> Some errors like this, but not this can be detected by plpgsql_check >> https://www.google.com/url?q=https://github.com/okbob/plpgsql_check&source=gmail-imap&ust=162914843400&usg=AOvVaw3f9UAP7RvDPC2QKi3_4Mj0 >> - probably

archive_command / single user mode

2021-08-09 Thread Christophe Pettus
Does archive_command run in single user mode? This isn't an actual situation at the moment, but for runbook / disaster planning purposes, I was curious.

Re: PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread Tom Lane
Pavel Stehule writes: > Some errors like this, but not this can be detected by plpgsql_check > https://github.com/okbob/plpgsql_check - probably the heuristic for type > check is not complete. STRICTMULTIASSIGNMENT would detect most cases of this, except that the condition is checked too late. W

Re: PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread Pavel Stehule
po 9. 8. 2021 v 21:41 odesílatel Bryn Llewellyn napsal: > *The problem that I report here seems to be known and seems, too, to > astonish and annoy users. It's a bare "computer says No". **It's hard to > find anything of ultimate use with Google search (either constrained to the > PG doc or uncon

Re: PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread John W Higgins
On Mon, Aug 9, 2021 at 12:41 PM Bryn Llewellyn wrote: > > *https://stackoverflow.com/questions/41843016/how-do-i-pass-a-user-defined-type-variable-to-a-function-as-a-parameter > *

Re: (13.1) pg_basebackups ./. pg_verifybackup

2021-08-09 Thread Matthias Apitz
El día lunes, agosto 09, 2021 a las 01:32:58p. m. -0700, Adrian Klaver escribió: > > > > What we do wrong here with pg_verifybackup? > > Not read the docs?: > > https://www.postgresql.org/docs/13/app-pgverifybackup.html > > "pg_verifybackup is used to check the integrity of a database cluster

Re: (13.1) pg_basebackups ./. pg_verifybackup

2021-08-09 Thread Adrian Klaver
On 8/9/21 1:15 PM, Matthias Apitz wrote: Hello, We do backups with something like: $ pg_basebackup -U ${DBSUSER} -Ft -z -D ${BACKUPDIR}-${DATE}-${NUM} and they seems to work fine: $ ls -l backup-20210809-1/ total 7656108 -rw--- 1 postgres postgres4191873 Aug 9 14:19 backup_manifest

(13.1) pg_basebackups ./. pg_verifybackup

2021-08-09 Thread Matthias Apitz
Hello, We do backups with something like: $ pg_basebackup -U ${DBSUSER} -Ft -z -D ${BACKUPDIR}-${DATE}-${NUM} and they seems to work fine: $ ls -l backup-20210809-1/ total 7656108 -rw--- 1 postgres postgres4191873 Aug 9 14:19 backup_manifest -rw--- 1 postgres postgres 7835635150

PL/pgSQL: Spurious 22P02 error on "select col into var" when col is user-defined type

2021-08-09 Thread Bryn Llewellyn
The problem that I report here seems to be known and seems, too, to astonish and annoy users. It's a bare "computer says No". It's hard to find anything of ultimate use with Google search (either constrained to the PG doc or unconstrained). Here's an example on stackoverflow: https://stackover

Re: JWT decoder

2021-08-09 Thread Mladen Gogala
Hmmm, Pl/Python and Pl/Perl are languages usable from within Postgres. You can write Python functions in Postgres. I apologize for not making that clear. On 8/9/21 1:15 AM, Masih Tavassoli wrote: There are lots of decoders but I need to do it within postgresql. On Monday, August 9, 2021, 01:2

Re: Partitioning a table by integer value (preferably in place)

2021-08-09 Thread Vijaykumar Jain
> > > > I have a 400GB joining table (one SMALLINT and the other INTEGER - > Primary Keys on other tables) with 1000 fields on one side and 10M on > the other, so 10,000M (or 10Bn) records all told. > My queries: > > Do you have any explain analyze,buffers results with the existing setup? Does

Re: Partitioning a table by integer value (preferably in place)

2021-08-09 Thread Ron
On 8/9/21 9:14 AM, Pól Ua Laoínecháin wrote: Hi again all, Just a quick follow-up - could I script the creation of 1000 partitions using bash Sure.  That's what scripting languages are for. or PL/pgSQL? I think (rightly/wrongly?) that this may be the best solution? I've found samples on t

Re: Partitioning a table by integer value (preferably in place)

2021-08-09 Thread Pól Ua Laoínecháin
Hi again all, Just a quick follow-up - could I script the creation of 1000 partitions using bash or PL/pgSQL? I think (rightly/wrongly?) that this may be the best solution? I've found samples on the web, but they are for partitioning by date - a quick sample by integer would be gratefully receive

Partitioning a table by integer value (preferably in place)

2021-08-09 Thread Pól Ua Laoínecháin
Hi all, Linux Fedora 34 1TB Samsung SSD 4 CPUs, 2 cores PostgreSQL 12.7 (can upgrade if a better solution is to be found in 13 or even 14 beta2 - currently testing a proposed solution, so by the time it's fully implemented, 14 should be on GA and hey, I might even find a bug or two to help with

Re: PostgreSQL general set of Questions.

2021-08-09 Thread Vijaykumar Jain
On Mon, 9 Aug 2021 at 12:14, A Z wrote: > 1) Are there free scripts for CREATE TYPE (native type), more advanced, > or sorts of types out there, online, free for commercial > use? With function support, too? Can someone reply with a link or a > suggestion? > > PostgreSQL: Documentation: 13: Cha

PostgreSQL general set of Questions.

2021-08-09 Thread David G. Johnston
On Sunday, August 8, 2021, A Z wrote: > > 2) How may I get PostgreSQL to output the create table statement(s) for > one or more tables inside one database, without issuing instructions via > the command line, but only inside a database login, as a query or pl/sql? > If not possible, what can you d