Re: Practice advice for use of %type in declaring a subprogram's formal arguments

2023-03-10 Thread Ron
On 3/10/23 15:28, Bryn Llewellyn wrote: I'm thinking about "language plpgsql" subprograms—but I expect that my question can be generalized to cover "language sql" too. The payload for "create [or replace]" for a "language plpgsql" subprogram specifies various metadata elements like its qualifi

Re: Practice advice for use of %type in declaring a subprogram's formal arguments

2023-03-10 Thread David G. Johnston
On Fri, Mar 10, 2023 at 2:28 PM Bryn Llewellyn wrote: > Do you (all) think that, notwithstanding this, it's a good plan to use > "%type" for the declaration of a formal argument just for the reason that > it documents your intention explicitly? > If my function is likely to be table-specific I w

Practice advice for use of %type in declaring a subprogram's formal arguments

2023-03-10 Thread Bryn Llewellyn
I'm thinking about "language plpgsql" subprograms—but I expect that my question can be generalized to cover "language sql" too. The payload for "create [or replace]" for a "language plpgsql" subprogram specifies various metadata elements like its qualified name, list of formal arguments and the

Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-10 Thread David G. Johnston
On Fri, Mar 10, 2023 at 1:29 PM Bryn Llewellyn wrote: > > david.g.johns...@gmail.com wrote: > > > >> b...@yugabyte.com wrote: > >> > >> « > >> SELECT select_expressions INTO [STRICT] target FROM …; > >> > >> where target can be a record variable, a row variable, or a > comma-separated list of sim

Re: select (17, 42)::s.t2 into... fails with "invalid input syntax"

2023-03-10 Thread Bryn Llewellyn
> david.g.johns...@gmail.com wrote: > >> b...@yugabyte.com wrote: >> >> « >> SELECT select_expressions INTO [STRICT] target FROM …; >> >> where target can be a record variable, a row variable, or a comma-separated >> list of simple variables and record/row fields. >> » >> >> In plain English,

Re: can't get psql authentication against Active Directory working

2023-03-10 Thread Tomas Pospisek
Hi Stephen, On 25.02.23 00:52, Stephen Frost wrote: * Tomas Pospisek (t...@sourcepole.ch) wrote: >> On 21.02.23 16:29, Stephen Frost wrote: * Tomas Pospisek (t...@sourcepole.ch) wrote: On 20.02.23 15:17, Stephen Frost wrote: * Tomas Pospisek (t...@sourcepole.ch) wrote: >> That [SSPI] doc

Re: Get more columns from a lookup type subselect

2023-03-10 Thread negora
For example, if you wanted to list book authors and the latest book of each one, I would do something like this:     SELECT         author.first_name,         author.surname,         latest_book.title,         latest_book.release_date     FROM author     CROSS JOIN LATERAL (         SELECT book.

Re: Get more columns from a lookup type subselect

2023-03-10 Thread Durumdara
Dear Negora! Can you show me the usage with some short examples? Thanks for it! BR dd negora ezt írta (időpont: 2023. márc. 10., P, 9:43): > Hi Chris: > > You can use a subselect in the `from` and `join` clauses. That's how I get > multiple columns from a single subselect. > > If the subs

Re: Get more columns from a lookup type subselect

2023-03-10 Thread negora
Hi Chris: You can use a subselect in the `from` and `join` clauses. That's how I get multiple columns from a single subselect. If the subselect needs to use a reference from the outer scope (i.e. the main query) , you can use the `lateral` modifier. Best regards. On 10/03/2023 08:34, Duru