Re: ***SPAM*** Re: Can I get the number of results plus the results with a single query?

2022-08-16 Thread Walter Dörwald
On 16 Aug 2022, at 0:13, Rob Sargent wrote: On 8/15/22 14:37, Perry Smith wrote: On Aug 15, 2022, at 08:55, David G. Johnston wrote: On Monday, August 15, 2022, Perry Smith wrote: I’ve been toying with row_number() and then sort by row_number descending and pick off the first

Re: Getting the table ID

2022-07-19 Thread Walter Dörwald
On 19 Jul 2022, at 5:10, Igor Korot wrote: Hi, guys, In the database theory each table is identified as "schema_name"."table_name". When I tried to look at how to get the table id inside the PostgreSQL, I saw that I needed to look at the pg_class table. SELECT oid FROM pg_class WHERE relnam

Re: Get the table creation DDL

2022-07-11 Thread Walter Dörwald
On 10 Jul 2022, at 17:40, Igor Korot wrote: Hi, Is there a query I can execute that will give me CREATE TABLE() command used to create a table? Thank you. I am using the following query for that: ```sql select a.attname, a.attnum, a.attnotnull, pg_catalog.fo