Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause

2022-03-22 Thread David G. Johnston
AQ#Why_doesn.27t_PostgreSQL_report_a_column_not_found_error_when_using_the_wrong_name_in_a_subquery.3F David J.

Re: PostgreSQL : bug (ou not) in CTE Common Table Expressions or Subqueries in the FROM Clause

2022-03-22 Thread David G. Johnston
olate the subquery in the manner you ascribe to them, you’ll just need to adapt to reality. Its doesn’t have to seem logical to you, but this is how it is defined to work and thus the observed behavior is not a bug. David J.

Re: Unexpected zero results

2022-03-23 Thread David G. Johnston
contains two elements with the same value? > That is just how SQL works. A result set does not have all of the characteristics of a formal mathematical set. Every produced row has a unique identity independent of the value(s) of the fields. There are SQL operations that can remove all but one of these identities from a result set based upon the comparison of the field values (DISTINCT, UNION, etc...). David J.

Re: Leading comments and client applications

2022-03-25 Thread David G. Johnston
ard to say (I don't actually use the tool myself though). [1] https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-COMMENTS [2] https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.Connection.execute David J.

Re: psql -f and PAGER

2022-03-29 Thread David G. Johnston
rst things people do in their psql non-interactive automations (or run them through the "tee" command...). It would be nice to not have to change the pager but I also don't see messing with the default. David J.

Re: PostgreSQL JSON

2022-04-03 Thread David G. Johnston
orks unless you want to report a demonstrated bug. You may wish to generalize a bit and just look at JSON and JSON Path materially generally, we didn't invent this stuff. David J.

Re: Transaction and SQL errors

2022-04-04 Thread David G. Johnston
;s not a good thing to do" remains to be seen but at least for now we are just saying no to an automatic rollback setting. David J.

Re: Cascade view drop permission checks

2022-04-06 Thread David G. Johnston
html which CASCADE links to as well, may be an omission worth fixing (or please point me to where this is covered…) David J.

Re: Cascade view drop permission checks

2022-04-06 Thread David G. Johnston
On Wednesday, April 6, 2022, m7o...@gmail.com wrote: > David, thank you for the clarification. > Should we consider raising log level for cascade drops from NOTICE to > WARNING? By now cascade drops appears in log files only when log level >= > NOTICE. > > --- a/src/backend

Re: Cascade view drop permission checks

2022-04-06 Thread David G. Johnston
rop. I suppose if we did have this kind of behavior we'd probably also have a way to inform the system that, basically, there are no select privileges (or some other spelling of "invalid") on the view, so any attempt to query the view would fail even while the view still exists. David J.

Re: What have I done!?!?!? :-)

2022-04-06 Thread David G. Johnston
esn’t re-check the existing record, it effectively deletes it, and then checks its replacement. So, yes, the constraints were probably “put back”, but it was too late, the invalid data was already saved. David J.

Re: psql removes dashed comments

2022-04-07 Thread David G. Johnston
meta-commands cannot be used. Including a filename should establish the behavior you desire. David J.

Re: psql removes dashed comments

2022-04-07 Thread David G. Johnston
e done here is demonstrate the documented behavior when the query buffer contains multiple commands when \e is executed. In either case this is working as documented and you really should be using a permanent file for this kind of thing. David J.

Re: PostgreSQL : error hint for LATERAL join

2022-04-08 Thread David G. Johnston
wn is wrong, but likely standard's mandated). If it were a true cross join the relation u produced 4 unique rows and the relation t produced 2, thus the output should have 8 rows. It only has four. Because the lateral takes precedence here and only matches a subset of the right-side output rows with the left side. David J.

Re: Constraint ordering

2022-04-09 Thread David G. Johnston
;m not aware of any documentation describing constraint evaluation order. David J.

Re: PostgreSQL : error hint for LATERAL join

2022-04-11 Thread David G. Johnston
ss join sin(x)" as I dislike the implicit format even more and the semantic mis-match with the cross join was unappealing as well. There really is no other option for a LEFT JOIN here so just the consistency with an INNER JOIN has now made writing "on true", at least for a lateral join, make sense to me. David J.

Re: alter function/procedure depends on extension

2022-04-12 Thread David G. Johnston
On Thu, Feb 17, 2022 at 9:32 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Thu, Feb 17, 2022 at 8:54 PM Tom Lane wrote: > >> "David G. Johnston" writes: >> > On Thu, Feb 17, 2022 at 6:17 PM Tom Lane wrote: >> >> There is no bu

Re: alter function/procedure depends on extension

2022-04-12 Thread David G. Johnston
On Tue, Apr 12, 2022 at 8:49 AM Tom Lane wrote: > "David G. Johnston" writes: > > - A function that's marked as dependent on an extension is > automatically > > - dropped when the extension is dropped. > > + A function that's ma

Re: function defined (or not), more worries on version 10->14 upgrade

2022-04-15 Thread David G. Johnston
_threshold_mono text text 'double precision' You need to quote the fourth argument to protect the embedded space as a character and not an argument separator. David J.

Re: function defined (or not), more worries on version 10->14 upgrade

2022-04-15 Thread David G. Johnston
atch the name and arguments at the same time when that isn't how the meta-command is defined to be used. David J.

Re: function defined (or not), more worries on version 10->14 upgrade

2022-04-15 Thread David G. Johnston
On Fri, Apr 15, 2022 at 2:30 PM Rob Sargent wrote: > On 4/15/22 15:18, David G. Johnston wrote: > > On Fri, Apr 15, 2022 at 2:04 PM Rob Sargent wrote: > >> but have not found a combination of name/args for >> genome_threshold_mono(text,text,double >> p

Re: function defined (or not), more worries on version 10->14 upgrade

2022-04-15 Thread David G. Johnston
On Fri, Apr 15, 2022 at 3:02 PM Rob Sargent wrote: > On 4/15/22 15:52, David G. Johnston wrote: > > > > On Fri, Apr 15, 2022 at 2:30 PM Rob Sargent wrote: > >> On 4/15/22 15:18, David G. Johnston wrote: >> >> On Fri, Apr 15, 2022 at 2:04 PM Rob Sargent &

Re: Facing issues with pgsql upgrade.

2022-04-17 Thread David G. Johnston
t to just forget doing a pg_upgrade migration and do a pg_dumpall one instead. The missing template databases on the existing cluster shouldn't be noticed. You can decide how important missing the directories are to you, since that shouldn't happen outside someone going in and "rm'ing" them. David J.

Re: oldest xmin is far in the past :: BUT xmin is not available in system

2022-04-18 Thread David G. Johnston
very table in every database manually, you probably should just do that. Vacuum freeze specifically. David J.

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-19 Thread David G. Johnston
ther the server should emit a notice or warning in this situation is less clear. I'm doubting we would introduce an error at this point but probably should have when parallelism was first added to the system. David J.

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-19 Thread David G. Johnston
On Tue, Apr 19, 2022 at 7:47 PM Julien Rouhaud wrote: > > On Tue, Apr 19, 2022 at 07:21:19PM -0700, David G. Johnston wrote: > > On Tue, Apr 19, 2022 at 7:07 PM Bryn Llewellyn > wrote: > > > > > > *alter function s1.f()security invokerset timezone =

Re: Can anyone confirm the flaw of postgres and how to deal with it?

2022-04-20 Thread David G. Johnston
l queries and output. Hopefully putting that information together will cause you to realize where you are wrong. If not we at least get something that is debuggable. David J.

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-20 Thread David G. Johnston
applied yesterday, at Tom's "Yeah, I arrived at the same fix." email. https://github.com/postgres/postgres/commit/344a225cb9d42f20df063e4d0e0d4559c5de7910 (I haven't figured out what the official way to reference a commit is, I use the GitHub clone for research so there ya go). David J.

Re: Unexpected result from ALTER FUNCTION— looks like a bug

2022-04-20 Thread David G. Johnston
On Wed, Apr 20, 2022 at 10:54 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > > > https://github.com/postgres/postgres/commit/344a225cb9d42f20df063e4d0e0d4559c5de7910 > > (I haven't figured out what the official way to reference a commit is, I > use the

Re: alter function/procedure depends on extension

2022-04-20 Thread David G. Johnston
On Tue, Apr 12, 2022 at 8:55 AM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Tue, Apr 12, 2022 at 8:49 AM Tom Lane wrote: > >> "David G. Johnston" writes: >> > - A function that's marked as dependent on an extension is >> auto

Re: autovacuum_freeze_max_age on append-only tables

2022-04-21 Thread David G. Johnston
m freeze on the table) owned by the table owner and grant your inserting process the ability to execute it. David J.

Re: Logical subscription / publication lifetimes

2022-04-22 Thread David G. Johnston
to the slot even while the subscriber is not active and the subscriber will receive all of it next time it comes online/re-enables. David J.

Re: SELECT creates millions of temp files in a single directory

2022-04-23 Thread David G. Johnston
om three or four examples is pointless. And, regardless, it isn't like any of those people are committers for the project, whose opinions are really the only ones that matter because they control whether to fix something or not. >People seem to have been brainwashed by Web-Services and OLTP, >and now think the working set must always fit in memory. But this >is only one possible usecase, it is not the exclusive only one. > > Again, your running commentary is providing zero, or negative, value here. David J.

Re: SELECT creates millions of temp files in a single directory

2022-04-23 Thread David G. Johnston
On Sat, Apr 23, 2022 at 1:58 PM Tom Lane wrote: > "David G. Johnston" writes: > > v12 what? > > That ... > > > It would help if you can provide a self-contained demonstration > > that others can then verify and debug (or explain). > > ... and th

Re: pg_stat_activity.query empty

2022-04-26 Thread David G. Johnston
/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW > > They've never executed a query. Probably due to connection pooling opening connections for the pool but never needing to hand them out. David J.

Re: row level security on conflict do update

2022-04-26 Thread David G. Johnston
That makes sense to me. but I don't get the line *733 > to 734. * > Also in the comment section, what does `quals + WCOs` mean? > > WCO := With Check Option clause(the word option is implicit in the actual clause name) + := And Security Barrier Quals := Using clause It is basically saying: "both RLS restriction types". What don't you get about 733/734? Inserting a row 2 (with valid dauthor value), row 2 exists so move to on conflict update, row 2 is visible to the update because its cid is 11, perform update since the new row will have a valid dauthor value. David J.

Re: Fresh eyeballs needed: input into error

2022-04-26 Thread David G. Johnston
,null,null,null); ERROR: relation "people" does not exist LINE 1: insert into people (person_nbr,lname,fname,job_title,company... No syntax error, that it didn't find the table is expected. Copied and pasted right from your email. David J.

Re: "create function... depends on extension..." not supported. Why?

2022-04-26 Thread David G. Johnston
Here is the commit that brought the feature into existence (it includes a link to the archives for discussion from which you can read or infer things). https://github.com/postgres/postgres/commit/f2fcad27d59c8e5c48f8fa0a96c8355e40f24273 David J.

Re: range of composite types!

2022-04-26 Thread David G. Johnston
ode it yourself - possibly including ignoring the generic composite type infrastructure and make a formal base type of whatever it is you need. David J.

Re: Backing up a DB excluding certain tables

2022-04-27 Thread David G. Johnston
d of encoding difference so the name you are typing in pg_dump and the name stored in the database, while looking the same, are actually different? Copy-and-paste the name from the pg_dump file back into the command line. David J.

Re: Backing up a DB excluding certain tables

2022-04-27 Thread David G. Johnston
On Wed, Apr 27, 2022 at 4:16 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Apr 27, 2022 at 3:46 PM JORGE MALDONADO > wrote: > >> Is this the correct way to answer when you say that I must *keep the >> list cc'd*? I am not sure if I only

Re: parallel-processing multiple similar query tasks - any example?

2022-04-27 Thread David G. Johnston
of multiple similar query tasks? > > Any example available? > > You should search for how to run processes/commands in parallel in whatever client-side execution environment you want to use. There isn't anything specific to PostgreSQL here. David J.

Re: parallel-processing multiple similar query tasks - any example?

2022-04-27 Thread David G. Johnston
On Wed, Apr 27, 2022 at 4:44 PM David G. Johnston < david.g.johns...@gmail.com> wrote: > On Wed, Apr 27, 2022 at 4:34 PM Shaozhong SHI > wrote: > >> multiple similar query tasks are as follows: >> >> select * from a_table where country ='UK' >> se

Re: ERROR: cursor variable must be a simple variable (LINE XX: OPEN vQuery.cursorReturn FOR )

2022-04-28 Thread David G. Johnston
d that cycle and since the current behavior matches the documentation, and there were/are no test cases for this situation, the behavior change isn't surprising. I'd accept a bug and backpatch solution here, though, if someone wished to write one. We currently support a version (10) that allows this code to execute, seemingly without issue. David J.

Re: External psql editor

2022-04-29 Thread David G. Johnston
in place from the query buffer. Upon returning you are given a new buffer with the contents of whatever you typed into the editor pasted in. David J.

Re: UUID vs serial and currval('sequence_id')

2022-05-02 Thread David G. Johnston
hat way myself). In pl/pgsql you can also use variables, and the same goes for psql - though that requires client involvement and so isn't generally that great a choice. David J.

Re: UUID vs serial and currval('sequence_id')

2022-05-02 Thread David G. Johnston
On Mon, May 2, 2022 at 4:24 PM Robert Stanford wrote: > On Tue, 3 May 2022 at 08:39, David G. Johnston > wrote: > >> You basically have to use "INSERT ... RETURNING" or variables. Which/how >> depends on the language you are writing in. Pure SQL without client &

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
in (player...) and (s.uid <> u.uid) Hopefully you get the idea, your "social" dynamic makes this more challenging. If you can just pass "my uid" into the function then figuring out which uid is "me" and which is "not me" becomes quite a bit easier. David J.

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
x27;ve just put player1 into the u1 slot. > ...but how to bring the u1.muted or u2.muted there? > > You can always write something like: CASE WHEN ... THEN u1.muted ELSE u2.muted END if you don't want to pre-define "me" and "them" David J.

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 8:21 AM Alexander Farber wrote: > David, I am trying your suggestion: > > On Wed, May 4, 2022 at 4:27 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> Assuming the base query is capable of returning all related chat messages >

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 8:36 AM Alexander Farber wrote: > David, I try then the following - > > On Wed, May 4, 2022 at 5:28 PM David G. Johnston < > david.g.johns...@gmail.com> wrote: > >> You missed quoting the part where I describe the on clauses you need to >&g

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
On Wed, May 4, 2022 at 8:53 AM Alexander Farber wrote: > > JOINcte > WHERE c.gid= in_gid > AND (c.uid = myself.uid OR NOT opponent.muted) > ORDER BY c.CREATED ASC; > > ERROR: syntax error at or near "WHERE" > LINE 67: WHERE c.gid= in_gi

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
CREATED ASC; > > but the error is: > > ERROR: missing FROM-clause entry for table "myself" > LINE 60: SELECT CASE WHEN player1 = myself.uid THEN play... > > What exactly are you trying to do in the "opponent" cte - and why do you think the myself cte is visible to it? David J.

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-04 Thread David G. Johnston
se. You've defined (social,sid) as a primary key, your LIMIT 1 just makes you look like you don't know or trust that and leaves the reader wondering. Using (SELECT uid FROM myself) provides the same result without the from/join reference; the usage in the case and the where clause could be rewritten to use opponent.uid so myself.uid only appears once. David J.

Re: Displaying chat by punished users only to themselves (db fiddle attached)

2022-05-05 Thread David G. Johnston
onent.uid <> in_uid) > > but still messages from the game #20 are displayed, even though I pass > in_gid = 10 > You want: gid and (uid or muted); what you have is: (gid and uid) or muted; based upon operator precedence. David J.

Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread David G. Johnston
rs to application errors and then return control to the calling application - which then needs to handle a clean return or an application-level error return. David J.

Re: Vertical partition

2022-05-06 Thread David G. Johnston
On Friday, May 6, 2022, Rama Krishnan wrote: > Hi , > > Can you pls tell us how to do a vertical partition in postgresql > Manually. “Create table” with the columns you want in each. You FK column will also be your PK column on the non-primary table. David J.

Re: Vertical partition

2022-05-06 Thread David G. Johnston
On Friday, May 6, 2022, Rama Krishnan wrote: > Thanks a lot. Which means normal primary key and foreign key relationship > right can u pls send me any reference link > Like what? Read the documentation for those commands and features. David J.

Re: How to get value wrapped in json?

2022-05-06 Thread David G. Johnston
s to manipulate it. David J.

Re: "A transaction cannot be ended inside a block with exception handlers."

2022-05-06 Thread David G. Johnston
when OTHERS then raise notice 'others - ok'; commit; end; David J.

Re: PLPGSQL - extra column existence in trigger

2022-05-07 Thread David G. Johnston
On Saturday, May 7, 2022, Durumdara wrote: > > > So is there any syntax to not fall on missing columns? > No. I’d probably approach this by generically converting the NEW record to json and working with that. Non-existent object keys return null when accessed. David J.

Re: The P0004 assert_failure exception assert_failure exception seems to be unhandleable

2022-05-08 Thread David G. Johnston
mply the SQLSTATE for that name is perfectly clear to me and doesn’t warrant the verbosity of the proposal to avoid. David J.

Re: Question on cast string to date

2022-05-09 Thread David G. Johnston
6c6dff0f0eb428 The goal seemed to be able to accept 5-digit years…this behavior change didn’t show in the tests (or discussion) though I didn’t look for the of testing the pre-existing failure mode. David J.

Re: Deferred constraint trigger semantics

2022-05-10 Thread David G. Johnston
rom the documentation: "Row-level BEFORE triggers fire immediately before a particular row is operated on, while row-level AFTER triggers fire at the end of the statement (but before any statement-level AFTER triggers)." https://www.postgresql.org/docs/current/trigger-definition.html David J.

Re: Deferred constraint trigger semantics

2022-05-10 Thread David G. Johnston
ity of Data Changes" sections > lets me see why the present restriction is needed. > > I imagine having to keep around a working set of what are the changed records is both memory intensive and also problematic should a future statement make yet more changes to the table. This is also an area that the SQL Standard does make rules in. And given that constraints are defined per-row everywhere else there is a pull to not push the envelope of our extension too far. David J.

Re: Deferred constraint trigger semantics

2022-05-11 Thread David G. Johnston
t it fires. > > To my surprise, it *is* legal to write code that accesses "old" and "new" > values. But, because many rows can be affected by a single statement, and > the trigger fires just once, the meanings of "old" and "new" are undefined. > I've seen that, in any test that I do, both are always set to NULL (which > seems reasonable). > I was thinking more about transition tables - though I admit it's not a complete thought given their opt-in nature. David J.

Re: effects of nullifying bytea column on storage

2022-05-11 Thread David G. Johnston
On Wednesday, May 11, 2022, David Gauthier wrote: > Hi: > psql (11.5, server 11.3) on linux > > I have a table with a bytea column which, of course, contains binary > data. After 60 days, I no longer need the binary data but want to retain > the rest of the record. Of course

Re: effects of nullifying bytea column on storage

2022-05-11 Thread David G. Johnston
On Wednesday, May 11, 2022, David Gauthier wrote: > Doesn't vacuum run automatically (or can it be set to run automatically) ? > > https://www.postgresql.org/docs/current/routine-vacuuming.html#AUTOVACUUM David J.

Re: Restricting user to see schema structure

2022-05-12 Thread David G. Johnston
ll disclosure: I've never done this in anger. > > Try select * from pg_class or select * from pg_attribute or any of the > other system catalogs. > > Which is exactly what most GUI applications that provide object browsing and viewing are going to use. David J.

Re: Restricting user to see schema structure

2022-05-12 Thread David G. Johnston
ant links/threads in the archives, though I didn't try that hard. David J.

Re: Restricting user to see schema structure

2022-05-12 Thread David G. Johnston
a response here but they do have their own list as well as documentation. It would be a purely UX thing though, a user who wants to see the object in schema1 can choose to do so manually. David J.

Re: Restricting user to see schema structure

2022-05-13 Thread David G. Johnston
d connect on the database directly. It is through their mandatory membership in the PUBLIC pseudo-role, and that role's default grant of connect on all newly created databases, that joe receives permission to connect. You can only revoke what has been explicitly granted so one must revoke the grant from PUBLIC - then re-assign it to the subset of roles that require it. https://www.postgresql.org/docs/current/ddl-priv.html David J.

Re: Restricting user to see schema structure

2022-05-16 Thread David G. Johnston
hrough PUBLIC. There is no privilege directly on Joe to revoke. I don't quite know how to address your random experimentation with pg_hba.conf. None of the things you showed are surprising though - were you expecting different? David J.

Re:

2022-05-16 Thread David G. Johnston
On Monday, May 16, 2022, Rama Krishnan wrote: > > > How to install pg_repack and use? > Two questions best answered by reading its documentation. David J. p.s. please remember to include a subject line in future emails.

Re: Alternative to slow SRF in SELECT?

2022-05-17 Thread David G. Johnston
T * FROM (...) AS temp (h) JOIN my_srf_func(h) ON true David J.

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
stgresql.org/docs/current/ddl-priv.html Not saying there isn't room for improvement here, I tend to agree that the SQL Command Reference section should be considered a primary jumping off point. But the chapter on Data Definition is basically mandatory reading once a DBA wants to do any non-tr

Re: TO_DATE function between PostgreSQL 8.2 and 9.4

2022-05-17 Thread David G. Johnston
ld try creating a user function named "to_date" with (timestamptz, text) as the signature and then inside the function cast the first argument to text explicitly before invoking the built-in to_date(text, text) function and returning its result. You may have to deal with namespace/search_path issues though... David J.

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
tion? And > correspondingly from the CREATE accounts for the objects of the other types? > > While I agree with the general premise that there is room for improvement here, the degree of problem and manner of solution presented here doesn’t seem like a specific solution I would endorse. David J.

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
On Tuesday, May 17, 2022, David G. Johnston wrote: > On Tuesday, May 17, 2022, Bryn Llewellyn wrote: >> >> Might it be possible to give the paragraph more prominence (like make it >> a note and start it with "WARNING" in large letters). And to x-ref it from >

Re: Restricting user to see schema structure

2022-05-17 Thread David G. Johnston
grant execute on function f() to public"? That would be good. > But I can't find wording to that effect on the page. > No, the changes are to the defaults for the public schema - which makes actually removing it from the database post-creation less necessary. David J.

Re: Who am I? Where am I connected?

2022-05-18 Thread David G. Johnston
appear to be it, at first glance. > > The server has no clue how the values sent to it came into existence - nor should it. Whether and how any particular client might expose this kind of debugging information (or upgrade it to proper state info) is up to the client. I do not know what option

Re: Reasons for not overwriting processed wal archives?

2022-05-18 Thread David G. Johnston
le, *and that it returns nonzero > status in this case*. > > Why exactly is this? > Newer doc versions also say: This is an important safety feature to preserve the integrity of your archive in case of administrator error (such as sending the output of two different servers to the same archive directory). David J.

Re: Casting a collation in an ORDER BY ... COLLATE

2022-05-21 Thread David G. Johnston
nd "EXECUTE" command for ways to do this within the server. Or use whatever client-side facilities you have at your disposal. David J.

Re: cast to domain with default collation issue.

2022-05-23 Thread David G. Johnston
; > --- > > My guess is that the following should be the same. > > > My reading of the docs say this is consistent with outcome #2. https://www.postgresql.org/docs/current/collation.html David J.

Re: cast to domain with default collation issue.

2022-05-24 Thread David G. Johnston
a is the > same as the output of *show lc_collate*. > > so there is no *non-default? * > > I’m not following the point you are trying to make. table111.a contributes the default collation for any expression needing a collation implicitly resolved. David J.

Re: cast to domain with default collation issue.

2022-05-25 Thread David G. Johnston
On Wednesday, May 25, 2022, jian he wrote: > > I personally feel wording *non-default* may not be that correct. Because > if the column is text then it automatically at least has default collation. > Non-default means “a value that is not the default value”. David J.

Re: connect permission based on database name

2022-05-25 Thread David G. Johnston
s "just a string"? > > > Search_path isn’t a security component and accepts, but ignores, unknown names. So yes, it is just a string. David J.

Re: Connect to specific cluster on command line

2022-05-25 Thread David G. Johnston
te wrapper scripts they put into the version-agnostic bin directory that deal with the version/cluster-name scheme they’ve setup before calling the core commands located in the version-specific install directory. David J.

Re: "Join Postgres on Slack" ?

2022-05-25 Thread David G. Johnston
ontact the workspace administrator > at Postgres for an invitation." The word "Postgres" is bolded. But it isn't > a link. > > What must I do to join? > There is a web form for getting invited. https://www.postgresql.org/community/ https://postgres-slack.herokuapp.com/ David J.

Re: Automatic PK values not added to new rows

2022-05-25 Thread David G. Johnston
delete command should make this self-evident. David J.

Re: existing row not found by SELECT ... WHERE CTID = ?

2022-05-26 Thread David G. Johnston
On Thursday, May 26, 2022, Matthias Apitz wrote: > > Is there any way to get with the old CTID to the row, for example with > the old CTID to the new one which the row now has after the update of the > row? > > No, there is no link between old and new in the main table. David J.

Re: Determine if range list contains specified integer

2022-05-27 Thread David G. Johnston
are ranges. PostgreSQL has actual range types. Using them instead of using text should make life considerably easier. If you can go with PostgreSQL v14 you get access to multirange types. Absent that you probably can use PostgreSQL array of ranges to accomplish a similar goal. David J.

Re: '{"x": 42, "y": null}'::jsonb != '{"x": 42}'::jsonb ... Really?

2022-06-03 Thread David G. Johnston
four tables: books, authors, genres, and book_author_intersections. Then I > scrunch each book back to a single JSON doc. I want to prove that I get > back what I started with. > Yeah, the lack of any goal of round tripping conversions from JSON through SQL and back into SQL makes proving that the system does such a thing problematic. You'll get a back something meaningfully equivalent, by your own argument, but not identical on a key-by-key basis. David J.

Re: Window function?

2022-06-04 Thread David G. Johnston
s supposed to show up twice in the output then the final solution is going to have to be a combination of this and window functions. You need the later in order to be able to say "input 4, appearance 1" and "input 4, appearance 2" - which lead/lag tends to help with. Then the group by becomes {input, appearance}. David J.

Re: Why password authentication failed for user "postgres"?

2022-06-05 Thread David G. Johnston
logged in as "osuser" and supply "-U postgres"; peer auth will work so long as osuser is mapped to postgres and you connect via the socket (i.e., local, not host). David J.

Re: cast to domain with default collation issue.

2022-06-09 Thread David G. Johnston
is specified. > > > +1 The lack of any explicitness pushes evaluation down to the base type - which is a behavioral thing as opposed to some kind of attribute it possesses. David J.

Re: Row level security insert policy does not validate update new values/content?

2022-06-09 Thread David G. Johnston
columns, or the table's data type, as an input argument and put the logic in there. Then just call the function in the policy with check and/or using clauses. David J.

Re: How to get response message

2022-06-10 Thread David G. Johnston
instead of using IN. If you want to return a useful count I'd move the delete into a CTE, add RETURNING, count(*) the results, and return that (changing the function output to either integer, text, or json as you desire). David J.

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-15 Thread David G. Johnston
x27;)::kv])::kvarr); ERROR: failed to find conversion function from kvarr to record[] So the interaction of a composite type and the domain over array seems to be the scope of the issue - which makes me thing bug even more. David J.

Re: ERROR: failed to find conversion function from key_vals_nn to record[]

2022-06-15 Thread David G. Johnston
non-conforming. COMMENT ON table.column IS '@NULLABLE - optional information the customer might not provide'). David J.

<    8   9   10   11   12   13   14   15   16   17   >